gpt4 book ai didi

android - javax.net.ssl.SSLException : Not trusted server certificate 异常

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:07:15 24 4
gpt4 key购买 nike

我正在尝试使用 XML 解析器从 Url(“https://....etc”)读取 XML 数据。但我面临以下错误。这是我的日志。

04-08 16:34:23.017: WARN/System.err(8052): javax.net.ssl.SSLException: Not trusted server certificate

04-08 16:34:23.098: WARN/System.err(8052): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:371)

04-08 16:34:23.107: WARN/System.err(8052): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)

04-08 16:34:23.107: WARN/System.err(8052): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)

04-08 16:34:23.107: WARN/System.err(8052): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:164)

04-08 16:34:23.116: WARN/System.err(8052): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)

04-08 16:34:23.116: WARN/System.err(8052): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)

04-08 16:34:23.116: WARN/System.err(8052): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)

04-08 16:34:23.116: WARN/System.err(8052): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)

04-08 16:34:23.127: WARN/System.err(8052): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)

04-08 16:34:23.127: WARN/System.err(8052): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)

04-08 16:34:23.127: WARN/System.err(8052): at androidexperts.apps.prontonnetworks.xmlparser.(xmlparser.java:108)

04-08 16:34:23.196: WARN/System.err(8052): at androidexperts.apps.prontonnetworks.prontonnetworks$HandlerServer.doInBackground(prontonnetworks.java:486)

04-08 16:34:23.232: WARN/System.err(8052): at androidexperts.apps.prontonnetworks.prontonnetworks$HandlerServer.doInBackground(prontonnetworks.java:1)

04-08 16:34:23.257: WARN/System.err(8052): at android.os.AsyncTask$2.call(AsyncTask.java:185)

04-08 16:34:23.287: WARN/System.err(8052): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)

04-08 16:34:23.307: WARN/System.err(8052): at java.util.concurrent.FutureTask.run(FutureTask.java:137)

04-08 16:34:23.317: WARN/System.err(8052): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)

04-08 16:34:23.317: WARN/System.err(8052): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)

04-08 16:34:23.317: WARN/System.err(8052): at java.lang.Thread.run(Thread.java:1096)

04-08 16:34:23.317: WARN/System.err(8052): Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found. 04-08 16:34:23.327: WARN/System.err(8052): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:168)

04-08 16:34:23.327: WARN/System.err(8052): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:366)

04-08 16:34:23.337: WARN/System.err(8052): ... 18 more

04-08 16:34:23.337: WARN/System.err(8052): Caused by: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found.

04-08 16:34:23.377: WARN/System.err(8052): at org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:149)

04-08 16:34:23.377: WARN/System.err(8052): at java.security.cert.CertPathValidator.validate(CertPathValidator.java:202)

04-08 16:34:23.377: WARN/System.err(8052): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:164)

有人知道吗?

最佳答案

您正尝试通过 HTTPS URL 连接,而您运行代码的设备不信任该站点提供的 SSL 证书。我建议你阅读 this question on setting up trust in the Apache HTTP Client .

关于android - javax.net.ssl.SSLException : Not trusted server certificate 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5594189/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com