Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android:无法验证SSL证书CertPath(证书损坏?)_Java_Android_Ssl Certificate - Fatal编程技术网

Java Android:无法验证SSL证书CertPath(证书损坏?)

Java Android:无法验证SSL证书CertPath(证书损坏?),java,android,ssl-certificate,Java,Android,Ssl Certificate,对于我的Android应用程序,我使用SSL与提供RESTAPI的服务的服务器通信 有时我的调用引发SSL异常,因为CertPathValidator无法验证证书链 我得到这个信息: java.security.cert.CertPathValidatorException:IssuerNameCN=GeoTrust全局CA,O=GeoTrust Inc.,C=US不匹配SubjectNameCN=RapidSSL CA,O=GeoTrust,Inc.,C=US签名证书 我说的对吗,这种情况发生

对于我的Android应用程序,我使用SSL与提供RESTAPI的服务的服务器通信

有时我的调用引发SSL异常,因为CertPathValidator无法验证证书链

我得到这个信息:

java.security.cert.CertPathValidatorException:IssuerNameCN=GeoTrust全局CA,O=GeoTrust Inc.,C=US不匹配SubjectNameCN=RapidSSL CA,O=GeoTrust,Inc.,C=US签名证书

我说的对吗,这种情况发生了,因为GeoTrust公司与GeoTrust公司不匹配,因为最后一个名称中有冒号,而第一个名称中没有冒号?我不应该总是通过服务器获得相同的证书吗


如何只在某些时候抛出此验证异常,而不总是抛出此异常?

您找到解决此问题的方法了吗?我在2012年仍然会遇到它……PS:在@BurninLeo有一个可能的解决方案,我想我只是不支持低于2.3.3的平台。在上面的2.3.3中,它工作正常。您找到解决此问题的方法了吗?我在2012年仍然会遇到它……PS:在@BurninLeo有一个可能的解决方案,我想我只是不支持低于2.3.3的平台。在上面的2.3.3中,它工作正常。