Watson 和 https 的问题

Issue with Watson and https

编辑:

我认为这与 Watson 无关,所以我发布了一个关于 javax.net 和 ssl

的不同问题

我有 3 个 Watson 服务,TTS、STT 和 Conversation,并入了一个 Java Spring 网络应用程序,所有三个都工作正常 运行 Eclipse/localhost 中的应用程序.我最近将生产服务器配置 (Apache/Tomcat) 更新为一个安全站点 (HTTPS/SSL,具有 LetsEncrypt 证书),以便访问 Chrome 中的麦克风。现在,当我部署应用程序时,我在执行 getVoices() TTS 方法时看到 SSLException。

javax.net.ssl.SSLException: Received fatal alert: bad_record_mac

我在 SO 中找不到任何与从安全站点访问 Watson 服务相关的文档或问题,但我认为考虑到 Chrome 访问麦克风的应用程序必须安全的要求,这是可能的.

是否需要设置、标志或其他配置才能使此工作正常进行?

这是日志的相关部分:

Caused by: javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) ~[?:1.7.0_80]
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359) ~[?:1.7.0_80]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343) ~[?:1.7.0_80]
at okhttp3.internal.io.RealConnection.connectTls(RealConnection.java:239) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.io.RealConnection.establishProtocol(RealConnection.java:196) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.io.RealConnection.buildConnection(RealConnection.java:171) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.io.RealConnection.connect(RealConnection.java:111) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.http.StreamAllocation.findConnection(StreamAllocation.java:187) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:123) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.http.StreamAllocation.newStream(StreamAllocation.java:93) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.http.HttpEngine.connect(HttpEngine.java:296) ~[okhttp-3.3.1.jar:?]
at okhttp3.internal.http.HttpEngine.sendRequest(HttpEngine.java:248) ~[okhttp-3.3.1.jar:?]
at okhttp3.RealCall.getResponse(RealCall.java:243) ~[okhttp-3.3.1.jar:?]
at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201) ~[okhttp-3.3.1.jar:?]
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163) ~[okhttp-3.3.1.jar:?]
at okhttp3.RealCall.execute(RealCall.java:57) ~[okhttp-3.3.1.jar:?]
at com.ibm.watson.developer_cloud.service.WatsonService.execute(WatsonService.java:179) ~[core-3.5.0.jar:?]

更新 #1

为了确保,我将 Apache/Tomcat 配置翻转回 HTTP,重新启动两者,并没有发生异常。所以,我的猜测是它要么是 Okhttp(Watson JDK 使用的)的问题,要么是 Apache/Tomcat 的配置问题。或者 Watson 可能无法识别 LetsEncrypt 证书?

更新#2

我一直在努力研究异常,我认为这可能是 Apache/Tomcat 配置问题,可能与 SSL 协议有关。我将其添加到 Apache httpd.conf 但问题仍然存在。

SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3

我添加了 Apache 和 Tomcat 标签,希望比我更熟悉他们的配置的人能为我指出正确的方向来解决这个问题。

我相信我找到了问题的原因。经过更多的研究和调试,我意识到它与 Watson、Apache 或 Tomcat 无关。正如我在对这个问题的编辑中指出的那样,我在此处发布了另一个更具体到 javax.net.ssl 的问题:。我在那里发布的答案包含我的发现的详细信息,但归根结底,原因似乎是 Java7 中的错误。我通过禁用 java.security 文件中的所有 Diffie-Hellman 密码套件来修复它。