这可能有点牵强,但我希望这里有人可以帮助我。我在 debian linux 服务器上的 jboss 后端上运行了一个 java 应用程序。传入的通信由另一台服务器上的 haproxy 路由到正确的后端。
应用程序的任务之一是向用户提供货运信息。它通过向 UPS 提供的第三方 API 发送 POST 请求来实现此目的(https://www.ups.com/us/en/services/technology-integration/online-tools-tracking.page?) 并显示结果。最近,我们应用程序中的跟踪功能开始抛出错误。深入研究我们应用程序的日志后,我发现了以下内容:
2021-10-28 10:00:00,142 ERROR [STDERR] Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
2021-10-28 10:00:00,142 ERROR [STDERR] at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
2021-10-28 10:00:00,142 ERROR [STDERR] at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
2021-10-28 10:00:00,142 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959)
2021-10-28 10:00:00,142 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
2021-10-28 10:00:00,142 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
2021-10-28 10:00:00,142 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702)
2021-10-28 10:00:00,142 ERROR [STDERR] at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
2021-10-28 10:00:00,142 ERROR [STDERR] at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
2021-10-28 10:00:00,142 ERROR [STDERR] at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
2021-10-28 10:00:00,142 ERROR [STDERR] at org.apache.commons.httpclient.methods.StringRequestEntity.writeRequest(Unknown Source)
2021-10-28 10:00:00,142 ERROR [STDERR] at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(Unknown Source)
2021-10-28 10:00:00,142 ERROR [STDERR] at org.apache.commons.httpclient.HttpMethodBase.writeRequest(Unknown Source)
2021-10-28 10:00:00,142 ERROR [STDERR] at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown Source)
2021-10-28 10:00:00,142 ERROR [STDERR] at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source)
2021-10-28 10:00:00,142 ERROR [STDERR] at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown Source)
2021-10-28 10:00:00,143 ERROR [STDERR] at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
2021-10-28 10:00:00,143 ERROR [STDERR] at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
据我所知,这是 SSL 请求的问题。出于某种原因,我们的应用程序拒绝了来自 API 的响应,认为它不安全。不幸的是,我有点不知道该怎么做才能真正解决这个问题。我如何确定故障发生的位置?我如何确定我需要在应用程序和/或代理服务器上进行哪些更改才能使我的应用程序和外部 API 之间的通信正常进行?
答案1
我找到了问题的根源。UPS API 需要至少一个来自特定列表的密码,而我的应用服务器没有安装任何兼容的密码。弄清楚如何修复该问题超出了这个问题的范围,所以我在这里创建了另一个问题:如何向 Java 应用服务器添加额外的密码套件?