【问题标题】:OAuth2 Authentication to Gmail throws SunCertPathBuilderException/SSLHandshakeException对 Gmail 的 OAuth2 身份验证引发 SunCertPathBuilderException/SSLHandshakeException
【发布时间】:2013-06-06 12:03:35
【问题描述】:

在我的应用程序中,我使用来自this Google example 的 OAuth2Authenticator 对 Gmail 进行身份验证,以通过 Imap 接收电子邮件。

代码运行良好,但最近几天一些用户报告了在尝试连接到 Gmail 时出现的错误。

sun.security.provider.certpath.SunCertPathBuilderException:无法 在以下位置找到请求目标的有效认证路径 sun.security.provider.certpath.SunCertPathBuilder.engineBuild(未知 来源)在 java.security.cert.CertPathBuilder.build(未知来源) 引起:sun.security.validator.ValidatorException:PKIX 路径构建 在 sun.security.validator.PKIXValidator.doBuild 失败(未知 来源)在 sun.security.validator.PKIXValidator.engineValidate(未知来源) 在 sun.security.validator.Validator.validate(Unknown Source) 在 sun.security.ssl.X509TrustManagerImpl.validate(未知来源)在 sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(未知 来源)原因:javax.net.ssl.SSLHandshakeException at sun.security.ssl.Alerts.getSSLException(未知来源)在 sun.security.ssl.SSLSocketImpl.fatal(未知来源)在 sun.security.ssl.Handshaker.fatalSE(未知来源)在 sun.security.ssl.Handshaker.fatalSE(未知来源)在 sun.security.ssl.ClientHandshaker.serverCertificate(未知来源) 在 sun.security.ssl.ClientHandshaker.processMessage(未知来源) 在 sun.security.ssl.Handshaker.processLoop(未知来源) sun.security.ssl.Handshaker.process_record(未知来源)在 sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)

ImapSSLStore 连接到端口 993 上的“imap.gmail.com”。

这不会发生在所有用户身上,也不会发生在上周之前。

有人也观察到这种行为吗? 提示赞赏!

【问题讨论】:

    标签: gmail oauth-2.0 imap


    【解决方案1】:

    您系统用于验证 SSL 证书的 X.509 配置似乎没有将 Google 的证书视为可信证书。这可能有多种原因。

    【讨论】:

    • 好的,奇怪的是它在上周之前对用户有效,而对于某些人来说它仍然有效。你能告诉我从哪里开始吗?
    猜你喜欢
    • 2021-05-22
    • 1970-01-01
    • 2022-10-24
    • 2016-05-26
    • 2020-06-24
    • 2015-06-20
    • 2018-11-14
    • 2021-11-09
    • 1970-01-01
    相关资源
    最近更新 更多