Error in JavaMail : PKIX path building failed unable to find valid certification path to requested target

前端 未结 6 1739
北荒
北荒 2020-12-14 07:27

I am trying to build an email client app in android and right now i want to configure the javaMail part.

i am trying to establish the connection with the imap server

6条回答
  •  猫巷女王i
    2020-12-14 07:37

    I've lost so many days searching for a solution, and this post was helps to me. I had the same problem. I created a pem file like here, and then, the cert file .pem, was incrusted in cacert file (a copy called TrustStore.jks) with this command:

    keytool.exe -import -noprompt -keystore TrustStore.jks -storepass changeit ^ -alias DOMAINNAME -file MYCERTFILE.pem

    (DOMAINNAME must be replace by hostname -this trick is very important-, and MYCERTFILE by file recent create...)

    I hope that this solution can helps to somebody.

提交回复
热议问题