B4J Question [SOLVED] Email Server

Eumel

Active Member
Licensed User
Longtime User
Hi ..

I try to run this tutorial https://www.b4x.com/android/forum/threads/building-a-mini-email-based-server.35030
https://www.b4x.com/android/forum/threads/building-a-mini-email-based-server.35030
Every time i get

B4X:
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

I searched the forum and find several threads to this error.

I tried with InstallCert, with keytool, downloaded portecle, tried with gmail, gmx, web, changed the ports from 587 to 465, used StartTLS and SSL all same result. certificate error.
The links on stackoverflow and oracle i followed too.
I installed java fresh jdk and jre (1.8.0_121). Changed the path in B4J to actual javac.exe

My cacerts file has all certificates saved. With telnet i can connect to the servers. Only the B4J app don´t run.

My B4J Version 5.00
My jNet Version 1.20

Which place do i forget to look for my error ?

-------------------
Eumel
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
hi!
With which email you are using it? because gmail will cause you a lot of problems. Beyond that, have you tried with your firewall of? if you are doing it within your company they may have a special protection for pop and smtp ports.
 
Upvote 0

Eumel

Active Member
Licensed User
Longtime User
Hi .
I tried with gmail.com, gmx.de and web.de.
All certificates are saved in cacerts file.
gmx.de allows to change the port from 587 (StartTLS) to 465 (SSL) but this also don´t work.

----------
Eumel
 
Upvote 0

Eumel

Active Member
Licensed User
Longtime User
Thx Erel, but don´t work

unsicher.PNG
 
Upvote 0

Eumel

Active Member
Licensed User
Longtime User
Yes Erel, always certificate error.
But a few minutes ago, i found the solution.

All tutorials for the certificate error, describe the solution with the JAVA_PATH

A normal user installs java and has eg C:\Program Files\Java\jre1.8.0_121 as JAVA_PATH.
So after using the InstallCert.jar you have to put the new jssecacerts inside your JAVA_PATH\lib\security (there is the cacerts located, too)

But ......

If you´ve the jdk installed, your JAVA_PATH is as described above AND you have inside the jdk directory an .....\jre\lib\security folder.
Inside this, you find a cacerts file too, and you have to put the jssecacerts file inside this folder while debug the app.

This was my mistake.

Thanks to all who helped.

------------------
Eumel
 
Upvote 0
Top