在做小程序开发的时候,本地调试没有问题,在真机上测试时报:
java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
通过查询得知,很有可能是服务器的https配置的有问题。
查看腾讯云的的官方文档:
发现自己的服务器上少配置了一条:
SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
加上这条后,小程序能够正常访问了。
另外,通过 命令: openssl s_client -debug -connect www.alipay.com:443 可以调试对应的https是否有问题。