Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javax.net.ssl.SSLHandshakeException on Travis CI

I have an android project that I'm attempting to test on Travis CI however when running the Robolectric (v3.2.2) tests I'm getting:

com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Algorithm constraints check failed on signature algorithm: SHA256WithRSAEncryption

This only happens on Travis and does not happen on my local machine (MacOS Sierra).

Any clues as to how to fix/workaround this error? Also, please let me know of any files/settings/etc that you'd like to see.

like image 291
Kyle Decot Avatar asked Oct 10 '17 16:10

Kyle Decot


1 Answers

Import your certificates into the new cacerts file

$cp $JAVA_HOME/jre/lib/security/cacerts $JAVA_HOME/jre/lib/security/jssecacerts

$keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/jssecacerts -storepass changeit -noprompt -alias {cert alias} -file {cert file}

Restart the application.

like image 84
AndresMontj Avatar answered Nov 06 '22 23:11

AndresMontj