While sending request to send mailgun email API, it shows error using java web application

I use mailgun to send email, but from the last day it shows an error during the POST request when sending email api, as shown below. I am using java / spring / AWS for my web application. I tried to restart the application and check if the certificate is already in the trust store, but we never generated trust store keys.

com.mashape.unirest.http.exceptions.UnirestException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: Failed to create PKIX path: sun.security.provider.certpath.SunCertPathBuilderException: cannot find a valid certification path to the requested target at com.mashape.unirest.http.HttpClientHelper.request (HttpClientHelper.java:143) at com.mashape.unirest.request.BaseRequest.asJson (BaseRequest.java:68)

+6
source share
2 answers

At 1/22, we renewed our SSL certificates because the Symantec PKI infrastructure became unreliable. Some older versions of Java do not have a "DigiCert Global Root G2".

:

  • CA "DigiCert Global Root G2" "cacerts".
  • JRE 8u91 ( ), .

"DigiCert Global Root G2" , https://www.digicert.com/digicert-root-certificates.htm. , .

, :

keytool -import -trustcacerts -keystore /path/to/cacerts -storepass changeit -noprompt -alias digicert-global-root-g2 -file /path/to/digicert.crt

Java Keystore , .

+13

(java). Mailgun:

,

, SSL > , . , > , CA/Browser Forum > Symantecs PKI. .

, , > , , > .

PHP -1) CA (https://curl.haxx.se/docs/caextract.html) , Mozilla. 2) CA .htaccess , : php_value curl.cainfo "/path/to/cacert.pem" php.ini, , curl.cainfo = "/path/to/cacert.pem"

cURL - _Ubuntu: _https://askubuntu.com/questions/646594/how-to-fix-ca-cert-issues-with-curl-in-ubuntu-14-04 RedHat: https://serverfault.com/questions/394815/how-to-update-curl-ca-bundle-on-redhat -.

, , . , :

, / . , /, .

, , . . , , , . Mailgun , , , .

, Keith @MG

. , CA , , .

+1

All Articles