unable to find valid certification path to requested target - SunCertPathBuilderException

Agi Alif4 years ago

Hello, i'm new for using traccar. While i want to send test notification via web and email i always got this error unable to find valid certification path to requested target - SunCertPathBuilderException (... < MailManager:139 < *:92 < NotificatorMail:34 < NotificationResource:63 < ...)
i've trying to import google certificate from google to traccar cacerts but nothing happens
Please help me to solve this error

Anton Tananaev4 years ago

Try different Java version.

Agi Alif4 years ago

i've try using java 8 and 14 but still got the same error. Would you recommend me what version of java should i try

Anton Tananaev4 years ago
Agi Alif4 years ago

i've trying the method from that thread by importing certificate from using google.com to jdk file, but still doesn't work. Should i pointing that certificate to jre in traccar file?

Anton Tananaev4 years ago

Wait. How did you set Java? You said you tried different Java versions.

Agi Alif4 years ago

First of all i didn't install the java, because it mention that traccar v4.2 above has included java in it. Than i install the jdk 14 first, cause it works fine on my friend installation, then i change it to jdk 8 by removing jdk 14 first. Btw, thanks for your respons Anton.

Anton Tananaev4 years ago

OK, but how did you run Traccar on JDK 14 or 8?

Agi Alif4 years ago

Sorry i dont really understand your question. I just start the traccar service

Anton Tananaev4 years ago

How did you tell Traccar which Java to use?

Zenon Panoussis3 years ago

On Centos 8 and recent Fedoras:

  1. Be root. Place your CA certificate(s) in /etc/pki/ca-trust/source/anchors/ and then run update-ca-trust. For example:
su -
cd /etc/pki/ca-trust/source/anchors/
wget --no-check-certificate https://www.cacert.org/certs/root_X0F.crt
wget --no-check-certificate https://www.cacert.org/certs/CAcert_Class3Root_x14E228.crt
update-ca-trust
  1. Edit traccar's startup script and reload systemd:
sed -i 's#ExecStart=/opt/traccar/jre/bin/java#ExecStart=/opt/traccar/jre/bin/java -Djavax.net.ssl.trustStore=/etc/pki/ca-trust/extracted/java/cacerts#' /etc/systemd/system/traccar.service
systemctl daemon-reload
  1. Restart traccar:
systemctl restart traccar

Once you have imported your custom CA on the system, it will be accepted by most (but not all) applications systemwide. Passing -Djavax.net.ssl.trustStore=/path/to/java/cacerts works with any java application, and traccar will work no matter which java version you use. If you upgrade traccar with the binary installer (traccar.run), you might have to repeat steps 2 and 3.