Google Recaptcha 的 SSLHandshakeException [英] SSLHandshakeException for Google Recaptcha

查看:116
本文介绍了Google Recaptcha 的 SSLHandshakeException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是在 JBoss7.0.2.Final 服务器上运行的 Java 1.7 应用程序.

I am using a Java 1.7 application running on a JBoss7.0.2.Final server.

我创建了一个 REST 端点来处理用户登录.这工作正常,但是当我调用 Google 的 recaptcha (v2) url (https://www.google.com/recaptcha/api/siteverify),我收到以下错误:

I created a REST endpoint to handle user login. This works fine, but when I call Google's recaptcha (v2) url (https://www.google.com/recaptcha/api/siteverify), I get the following error:

javax.net.ssl.SSLHandshakeException:收到致命警报:握手_失败

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

昨天没有任何错误,我们的服务器没有任何变化,所以我怀疑谷歌端可能发生了一些变化.

This was working with no errors yesterday, and there have been no changes on our server, so I suspect something might have changed on googles end.

问题

有谁知道为什么我今天开始收到这个错误,我该如何解决?

Does anyone know why I have started to get this error today, and how I can resolve it?

更多信息:

我已尝试使用以下参数构建我们的应用程序 (mvn clean install),但没有任何区别.

I have tried building our application (mvn clean install) with the following paramaters, but it makes no difference.

-Dhttps.protocols=TLSv1.2,TLSv1.1,TLSv1

更多信息:

如果我直接使用 Postman 调用 Google 的验证端点,我不会收到握手错误:

If I call Google's verify endpoint directly with Postman, I don't get the handshake error:

POST https://www.google.com/recaptcha/api/siteverify?secret=seceret-key&response=rechapta

此外,如果我从我们拥有的另一个 JBoss 服务器(本地主机和另一个环境)调用它,它不会收到握手错误.

Also if I call it from another JBoss servers we have (localhost & another environment), it does not get the handshake error.

所以我们服务器上的某些东西一定不正确.

So something must not be correct on our server.

推荐答案

Google 有多个根 CA.您需要检查当前 CA 的 Google PKI 存储库并将它们全部添加到密钥库中,以确保 SSL 握手始终成功运行.您可以在此处访问 PKI 存储库 https://pki.goog/repository/

Google has multiple Root CAs. You need to check the Google PKI repository for the current CAs and add all of them to the keystore to ensure SSL Handshakes work successfully at all times. You can access the PKI repository here https://pki.goog/repository/

这篇关于Google Recaptcha 的 SSLHandshakeException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆