B4J Question Push Notification Android (USing b4J Email App)

daniedb

Active Member
Licensed User
Longtime User
Hi Guys
Working through the example Push Notification No Server
Got the API Key, and Project ID.
B4J Desktop App Compiles fine, but
when click "Check now" I receive this error
B4X:
11/26/2015 20:40:10: Error: (SunCertPathBuilderException) sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

In B4J Debug Window this
B4X:
Program started.
Checking mails
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at sun.security.ssl.SSLSocketImpl.checkEOF(Unknown Source)
   at sun.security.ssl.SSLSocketImpl.checkWrite(Unknown Source)
   at sun.security.ssl.AppOutputStream.write(Unknown Source)
   at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
   at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
   at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
   at sun.nio.cs.StreamEncoder.flush(Unknown Source)
   at java.io.OutputStreamWriter.flush(Unknown Source)
   at java.io.BufferedWriter.flush(Unknown Source)
   at org.apache.commons.net.pop3.POP3.sendCommand(POP3.java:239)
   at org.apache.commons.net.pop3.POP3.sendCommand(POP3.java:282)
   at org.apache.commons.net.pop3.POP3Client.logout(POP3Client.java:235)
   at anywheresoftware.b4a.net.POPWrapper.CloseNow(POPWrapper.java:302)
   at anywheresoftware.b4a.net.POPWrapper$1.run(POPWrapper.java:147)
   at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


I have NO CLUE What to DO
Any Advice will be appreciated

Thanks
Danie
 

daniedb

Active Member
Licensed User
Longtime User
Hi Erel

B4X:
  Private popServer = "pop.gmail.com" , user = "ffffff@gmail.com", password = "fffff"As String
   Private smtpServer = "smtp.gmail.com" As String
   Private apikey As String = "AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxx8"
   Private popPort = 995, smtpPort = 587 As Int
Thanks
Danie
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Try the attached jar file.

You need to run it with:
B4X:
java -cp InstallCert.jar InstallCert pop.gmail.com:995

InstallCert license:
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Sun Microsystems nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 

Attachments

  • InstallCert.jar
    4.5 KB · Views: 341
Upvote 0

daniedb

Active Member
Licensed User
Longtime User
Hi Erel

Ok, now we getting somewehere
Seems like the Java error STOPPED, but google now prevent Auth

B4X:
11/29/2015 16:26:28: Error: (RuntimeException) java.lang.RuntimeException: Error during login: -ERR [AUTH] Web login required: https://support.google.com/mail/answer/78754

Run the command as suggested.
Program still give me an error, and then I received this on my mobile

Someone just try to sign to your Google account xxxx@gmail.com from an app that doesn't meet modern security standards

I've checked, Double check my settings/Password. Everything seems fine

Thanks
Danie
 
Last edited:
Upvote 0

daniedb

Active Member
Licensed User
Longtime User
HI Erel

Thanks, got the B4J app going (After Less Secure email) , Now the B4A app, when enter a name and register it says
INVALID_SENDER

Thanks
Danie
 
Upvote 0

daniedb

Active Member
Licensed User
Longtime User
Ok, got basically everything sorted. Program Compiles fine. Android APP (Device) when register detect in B4J APP

Now, when I try to send a message I get the following Error
12/03/2015 20:02:48: Error sending message: Unauthorized

Why wil it be Unaithorized when trying to sedn with the b4J app

Thanks
Danie
 
Upvote 0

daniedb

Active Member
Licensed User
Longtime User
Hi Erel
Check en recheck password. Also email address
It's printed in the Bj4 Email APP.
The Android APP runs fine and I can register to the B4J Email APP
I can receive messages in the B4J app. But as soon as I try to send a message from the B4j App to selected device/s it fails authetication

Thanks
Danie
 

Attachments

  • b4j.JPG
    b4j.JPG
    55.9 KB · Views: 350
Upvote 0

daniedb

Active Member
Licensed User
Longtime User
Thanks Erel. Got this sorted. I created the Wong API key in Google, Now Ive got it, aswell as a valid Project ID

Appreciate all the help
Cherio
Danie
 
Upvote 0
Top