【发布时间】:2017-04-17 15:45:19
【问题描述】:
编辑:
我认为这与 Watson 无关,所以我发布了一个关于 javax.net 和 ssl here
的不同问题我有 3 个 Watson 服务,TTS、STT 和 Conversation,并入了 Java Spring Web 应用程序,并且这三个服务都可以在 Eclipse/localhost 中正常运行该应用程序。我最近将生产服务器配置(Apache/Tomcat)更新为一个安全站点(带有 LetsEncrypt 证书的 HTTPS/SSL),以便在 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$1.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 标签,希望比我更熟悉他们的配置的人可以为我指出解决这个问题的正确方向。
【问题讨论】:
标签: ssl apache2 text-to-speech tomcat8 ibm-watson