我跑openssl s_client -connect mywishboard.com:443 | openssl x509 -noout -subject -issuer
我得到有关证书的以下信息(由客户开发人员设定)
depth=2 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate Signing, CN = StartCom Certification Authority
verify return:1
depth=1 C = IL, O = StartCom Ltd., OU = StartCom Certification Authority, CN = StartCom Class 1 DV Server CA
verify return:1
depth=0 CN = mywishboard.com
verify return:1
subject= /CN=mywishboard.com
issuer= /C=IL/O=StartCom Ltd./OU=StartCom Certification Authority/CN=StartCom Class 1 DV Server CA
然后我查看Settings/system/trusted certificats
,看看StartCom Ltd就在其中
但是,当我要发出https请求时,它们会抛出
javax.net.ssl.SSLHandshakeException:
java.security.cert.CertPathValidatorException:
Trust anchor for certification path not found
如果我使用curl -I https://mywishboard.com/xxx
,则返回
curl: (60) server certificate verification failed. CAfile: /etc/ssl
/certs/ca-certificates.crt CRLfile: none
该证书是否格式错误,或者我是否需要将其明确安装到Android设备?(但据我了解,如果证书是与受信任的CA颁发者签署的,那么我不需要安装它,我是对的吗?)
答案 0 :(得分:2)
有两个潜在的问题:
答案 1 :(得分:2)
完成证书链所需的网站does not provide an intermediate certificate。某些客户端(如Android)无法构建完整的证书路径,并且在发生这种情况时不信任证书。
如果您是网站管理员,解决此问题的正确方法是download and supply the intermediate certificate,以便发送完整的链。