Hi Eric\All,
Fiddler has been an invaluable tool for me over the last year viewing
SSL traffic from a Java application to an external commercial web
service (XML requests\responses). Recently I had a corporate upgrade
from a 32 bit XP machine to a 64 bit Windows 7 machine but can't get
Fiddler intercepting the SSL traffic on the new machine with the same
setup.
When "Decrypt HTTPS traffic" is off, the Java application works fine
(I see the "Tunnel to" connections in Fiddler), but when I turn on
that flag I'm getting "Remote host closed connection during handshake"
exceptions in the Java app's log.
I thought it might be something to do with different Fiddler versions,
so upgraded to the same version on my XP machine (2.3.8.3) and it
works great! (Same Fiddler version, same Fiddler settings, same Java
app, same config, same web service called etc). Just can't see what's
different in the setup that is causing the issue on Windows 7 machine!
I've turned on SSL handshake debugging in Java App (see below). I'm
not too familiar with the SSL protocol, so hoping someone understand
what's going wrong. Appreciate any help (besides stick to the XP
machine :)
One difference I have noticed, when that flag is off Fiddler shows "A
SSLv3-compatible ClientHello handshake was found", when that flag is
on Fiddler shows "A SSLv2-compatible ClientHello handshake was found",
does this make sense to you?
Cheers,
Karl.
Details below:
Fiddler Web Debugger (v2.3.8.3)
Built: 13 January 2012
Capture HTTPS CONNECTS: On
Decrypt HTTPS traffic (from all processes): On
Ignore server certificate errors: On
JDK: 1.6.0_29 (tried both 32 bit and 64 bit)
Fiddler Root Cert added to cacerts file as trusted CA
Java's SSL Handshake Debug Info (cut out the adding of all the other
certs from info below):
eyStore is :
keyStore type is : jks
keyStore provider is :
init keystore
init keymanager of type SunX509
trustStore is: C:\Program Files (x86)\Java\jdk1.6.0_29\jre\lib\security
\cacerts
trustStore type is : jks
trustStore provider is :
init truststore
adding as trusted cert:
Subject: CN=DO_NOT_TRUST_FiddlerRoot, O=DO_NOT_TRUST, OU=Created by
http://www.fiddler2.com
Issuer: CN=DO_NOT_TRUST_FiddlerRoot, O=DO_NOT_TRUST, OU=Created by
http://www.fiddler2.com
Algorithm: RSA; Serial number: 0x2b80c3d2da1e38924415940c7ee0a041
Valid from Thu Jan 12 00:00:00 GMT 2012 until Tue Jan 11 23:59:59
GMT 2022
trigger seeding of SecureRandom
done seeding SecureRandom
Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
main, setSoTimeout(120000) called
%% No cached client session
*** ClientHello, TLSv1
RandomCookie: GMT: 1326945876 bytes = { 121, 110, 139, 121, 50, 159,
225, 75, 213, 123, 46, 107, 8, 254, 47, 84, 146, 109, 2, 199, 199,
186, 221, 37, 14, 18, 22, 48 }
Session ID: {}
Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA,
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA,
SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5,
SSL_RSA_EXPORT_WITH_DES40_CBC_SHA,
SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA,
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,
TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
Compression Methods: { 0 }
***
main, WRITE: TLSv1 Handshake, length = 75
main, WRITE: SSLv2 client hello message, length = 101
main, received EOFException: error
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote
host closed connection during handshake
main, SEND TLSv1 ALERT: fatal, description = handshake_failure
main, WRITE: TLSv1 Alert, length = 2
main, called closeSocket()
main, called close()
main, called closeInternal(true)
main, called close()
main, called closeInternal(true)
main, called close()
main, called closeInternal(true)
Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
main, setSoTimeout(120000) called
%% No cached client session
*** ClientHello, TLSv1
RandomCookie: GMT: 1326945877 bytes = { 47, 73, 34, 138, 173, 3, 170,
59, 46, 120, 163, 141, 74, 154, 79, 124, 53, 61, 178, 70, 120, 212,
34, 152, 255, 178, 89, 172 }
Session ID: {}
Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA,
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA,
SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5,
SSL_RSA_EXPORT_WITH_DES40_CBC_SHA,
SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA,
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,
TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
Compression Methods: { 0 }
***
main, WRITE: TLSv1 Handshake, length = 75
main, WRITE: SSLv2 client hello message, length = 101
main, received EOFException: error
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote
host closed connection during handshake
main, SEND TLSv1 ALERT: fatal, description = handshake_failure
main, WRITE: TLSv1 Alert, length = 2
main, called closeSocket()
main, called close()
main, called closeInternal(true)
main, called close()
main, called closeInternal(true)
main, called close()
main, called closeInternal(true)
Java App's log:
org.apache.axis2.AxisFault: Remote host closed connection during
handshake
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:
83)
at
org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:
84)
at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:
499)
at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:
2114)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:
1096)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:
398)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:
171)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
397)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
346)
at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:
542)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:
189)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:
75)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:
371)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:
209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:
401)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:
228)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:
163)
...etc etc
Caused by: com.ctc.wstx.exc.WstxIOException: Remote host closed
connection during handshake
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)
at
org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:
146)
at
org.apache.axiom.om.impl.MTOMXMLStreamWriter.getOutputStream(MTOMXMLStreamWriter.java:
394)
at com.barra.cp.bdtbeans.BDTServiceStub
$37.serialize(BDTServiceStub.java:8083)
at
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:
664)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:
918)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:
947)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:
240)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:
228)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:
947)
at
org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:
471)
at
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:
79)
... 23 more
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed
connection during handshake
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:
849)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:
1170)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:
637)
at
com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:
88)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:
65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at
org.apache.commons.httpclient.ChunkedOutputStream.flush(ChunkedOutputStream.java:
191)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:
214)
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
... 34 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:
333)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:
830)
... 43 more
When Decrpt HTTPS Traffic is off, this is what I see in Fiddler:
Request:
CONNECT <external_host_name_here>:443 HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: external_host_name_here
Proxy-Connection: Keep-Alive
A SSLv2-compatible ClientHello handshake was found. Fiddler extracted
the parameters below.
Major Version: 3
Minor Version: 1
Random: 4F 18 AE 01 04 3E EC 41 E5 CA 42 2A E9 51 E3 2A 7E 3F 84 F9 D0
26 13 B2 5D 7D 4C 18 B9 47 CE DB
SessionID: empty
Ciphers:
[0004] SSL_RSA_WITH_RC4_128_MD5
[10080] SSL2_RC4_128_WITH_MD5
[0005] SSL_RSA_WITH_RC4_128_SHA
[002F] TLS_RSA_AES_128_SHA
[0033] TLS_DHE_RSA_WITH_AES_128_SHA
[0032] TLS_DHE_DSS_WITH_AES_128_SHA
[000A] SSL_RSA_WITH_3DES_EDE_SHA
[700C0] SSL2_DES_192_EDE3_WITH_MD5
[0016] SSL_DHE_RSA_WITH_3DES_EDE_SHA
[0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA
[0009] SSL_RSA_WITH_DES_SHA
[60040] SSL2_DES_64_WITH_MD5
[0015] SSL_DHE_RSA_WITH_DES_SHA
[0012] SSL_DHE_DSS_WITH_DES_SHA
[0003] SSL_RSA_EXPORT_WITH_RC4_40_MD5
[20080] SSL2_RC4_128_EXPORT40_WITH_MD5
[0008] SSL_RSA_EXPORT_WITH_DES40_SHA
[0014] SSL_DHE_RSA_EXPORT_WITH_DES40_SHA
[0011] SSL_DHE_DSS_EXPORT_WITH_DES40_SHA
[00FF] TLS_EMPTY_RENEGOTIATION_INFO_SCSV
Response:
HTTP/1.1 200 Connection established
EndTime: 23:58:02.207
ClientToServerBytes: 3237
ServerToBytes: 3145
This is a CONNECT tunnel, through which encrypted HTTPS traffic flows.
To view the encrypted sessions inside this tunnel, enable the Tools >
Fiddler Options > HTTPS > Decrypt HTTPS traffic option.
A SSLv3-compatible ServerHello handshake was found. Fiddler extracted
the parameters below.
Major Version: 3
Minor Version: 1
SessionID: 7C 21 9E 09 2B 49 A1 5B 12 B2 C3 18 AE 2D 3E D9 7F FE B3 1C
F3 68 ED CE 78 E6 95 F3 8F F0 9F 06
Random: 87 85 3A 61 3A 94 BC BA C7 7F 5B 89 65 8C 2E C6 D8 F0 9B 83 B3
2D 54 8E A5 B6 DB E1 71 22 CB D1
Cipher: 0x04
When Decrypt HTTPS traffic is on, this is what I see
Request:
Host: <external_host_name_here>
Proxy-Connection: Keep-Alive
A SSLv2-compatible ClientHello handshake was found. Fiddler extracted
the parameters below.
Major Version: 3
Minor Version: 1
Random: 4F 18 B4 C1 74 6B 4A 89 E6 54 E7 4D 0A 26 0F D9 BA 55 66 79 D0
7A 92 59 53 95 46 12 79 44 82 F9
SessionID: empty
Ciphers:
[0004] SSL_RSA_WITH_RC4_128_MD5
[10080] SSL2_RC4_128_WITH_MD5
[0005] SSL_RSA_WITH_RC4_128_SHA
[002F] TLS_RSA_AES_128_SHA
[0033] TLS_DHE_RSA_WITH_AES_128_SHA
[0032] TLS_DHE_DSS_WITH_AES_128_SHA
[000A] SSL_RSA_WITH_3DES_EDE_SHA
[700C0] SSL2_DES_192_EDE3_WITH_MD5
[0016] SSL_DHE_RSA_WITH_3DES_EDE_SHA
[0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA
[0009] SSL_RSA_WITH_DES_SHA
[60040] SSL2_DES_64_WITH_MD5
[0015] SSL_DHE_RSA_WITH_DES_SHA
[0012] SSL_DHE_DSS_WITH_DES_SHA
[0003] SSL_RSA_EXPORT_WITH_RC4_40_MD5
[20080] SSL2_RC4_128_EXPORT40_WITH_MD5
[0008] SSL_RSA_EXPORT_WITH_DES40_SHA
[0014] SSL_DHE_RSA_EXPORT_WITH_DES40_SHA
[0011] SSL_DHE_DSS_EXPORT_WITH_DES40_SHA
[00FF] TLS_EMPTY_RENEGOTIATION_INFO_SCSV
Response:
HTTP/1.1 200 Connection established