调试连接到 WireMock 的 SSL 握手错误
Debugging SSL handshake errors connecting to WireMock
当我尝试连接到 WireMock 时遇到神秘的 SSL 握手错误 - error:140790E5:SSL routines:ssl23_write:ssl handshake failure:s23_lib.c:177:
WireMock 独立版 运行 --https-keystore
指向我使用 keytool
验证的证书。常规 HTTP 模拟工作正常。
我打开了 --print-all-network-traffic
,当我调用 openssl s_client -connect 127.0.0.1:443 -showcerts -status -state -debug
时,我看到的是:
2017-07-08 23:36:55.881 Opened Socket[addr=/172.17.0.1,port=46404,localport=443]
2017-07-08 23:36:55.886 Problem decoding network traffic
java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:816)
at com.github.tomakehurst.wiremock.http.trafficlistener.ConsoleNotifyingWiremockNetworkTrafficListener.incoming(ConsoleNotifyingWiremockNetworkTrafficListener.java:25)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServer$NetworkTrafficListenerAdapter.incoming(JettyHttpServer.java:364)
at org.eclipse.jetty.io.NetworkTrafficSelectChannelEndPoint.notifyIncoming(NetworkTrafficSelectChannelEndPoint.java:125)
at org.eclipse.jetty.io.NetworkTrafficSelectChannelEndPoint.fill(NetworkTrafficSelectChannelEndPoint.java:48)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:507)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:239)
at org.eclipse.jetty.io.AbstractConnection.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:748)
2017-07-08 23:36:55.895 Closed Socket[addr=/172.17.0.1,port=46404,localport=443]
2017-07-08 23:36:55.896 Closed Socket[addr=/172.17.0.1,port=46404,localport=443]
关于从这里到哪里去的任何想法?
这就是您只提供 public 证书时的样子。
当我尝试连接到 WireMock 时遇到神秘的 SSL 握手错误 - error:140790E5:SSL routines:ssl23_write:ssl handshake failure:s23_lib.c:177:
WireMock 独立版 运行 --https-keystore
指向我使用 keytool
验证的证书。常规 HTTP 模拟工作正常。
我打开了 --print-all-network-traffic
,当我调用 openssl s_client -connect 127.0.0.1:443 -showcerts -status -state -debug
时,我看到的是:
2017-07-08 23:36:55.881 Opened Socket[addr=/172.17.0.1,port=46404,localport=443]
2017-07-08 23:36:55.886 Problem decoding network traffic
java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:816)
at com.github.tomakehurst.wiremock.http.trafficlistener.ConsoleNotifyingWiremockNetworkTrafficListener.incoming(ConsoleNotifyingWiremockNetworkTrafficListener.java:25)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServer$NetworkTrafficListenerAdapter.incoming(JettyHttpServer.java:364)
at org.eclipse.jetty.io.NetworkTrafficSelectChannelEndPoint.notifyIncoming(NetworkTrafficSelectChannelEndPoint.java:125)
at org.eclipse.jetty.io.NetworkTrafficSelectChannelEndPoint.fill(NetworkTrafficSelectChannelEndPoint.java:48)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:507)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:239)
at org.eclipse.jetty.io.AbstractConnection.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:748)
2017-07-08 23:36:55.895 Closed Socket[addr=/172.17.0.1,port=46404,localport=443]
2017-07-08 23:36:55.896 Closed Socket[addr=/172.17.0.1,port=46404,localport=443]
关于从这里到哪里去的任何想法?
这就是您只提供 public 证书时的样子。