SunCertPathBuilderException: unable to find valid certification path to requested target in CN1 app

故事扮演 提交于 2019-12-03 09:10:44

This happens if the signing authority isn't recognized by the underlying JDK. Assuming you purchased your certificate from a valid source it's possible that it uses a relatively new root which means you need to use the latest version of JDK 8.

E.g. letsencrypt was only added in JDK 8 update 101.

It is now working.

  1. (On cloud tomcat) I made sure the root certificate and the intermediary certificate were in my keystore (as per the links i previously included). I included my .ca-bundle in the keystore for good measure.

  2. (On cloud tomcat) And i noticed i was using an older version of the Apache configuration (lesson learned about relying on older forum posts). Needed to have SSLCACertificateFile pointing to my .ca-bundle file, rather than using SSCertificateChainFile, in my apache .conf file.

  3. It still error on my simulator but works on my iphone, which points (as Shai says) to differing JDK's i expect, so upgraded my laptop to the higher JDK 1.8.171. This didn't in itself make a difference but probably required.

  4. Through digging around i realised that simulators on my laptop needed the above also. So i ended up running the statements below, in command prompt as Administrator, and now my simulator is working.

    cd %java_home%\jre\lib\security

    path=%java_home\bin

    keytool -import -alias comodo -keystore cacerts -file C:\path\ComodoRoot.cer

    keytool -import -alias comodo_intermediate -keystore cacerts -file C:\path\ComodoInter.cer

    keytool -import -alias purchased_cert -keystore cacerts -file C:\path\my_purchased_cert.crt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!