fiddler调试手机app的https请求时,出现After the client received notice of the established CONNECT, it failed to send any data.

coolcao 发布于 2014/10/31 15:03
阅读 9K+
收藏 1

我在使用Fiddler调试手机app的时候,手机app发送的是https请求,有的手机可以发送成功,有的不能。

能发送成功的时候有两条:

# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
84 200 HTTP Tunnel to api.demo.com:443 0
request的inspectors里是:

A SSLv3-compatible ClientHello handshake was found. Fiddler extracted the parameters below.


Version: 3.1 (TLS/1.0)
Random: 54 53 05 AF F2 98 F1 7A 5A AB F4 65 55 46 A6 3E 65 DA 2F AA 07 FC CC 9B 3D BB A9 43 BC FE BA 72
"Time": 2063/1/19 0:03:32
SessionID: empty
Extensions: 
server_name api.find.nutspace.com
ec_point_formats uncompressed [0x0], ansiX962_compressed_prime [0x1], ansiX962_compressed_char2  [0x2]
elliptic_curves sect571r1 [0xE], sect571k1 [0xD], secp521r1 [0x19], sect409k1 [0xB], sect409r1 [0xC], secp384r1 [0x18], sect283k1 [0x9], sect283r1 [0xA], secp256k1 [0x16], secp256r1 [0x17], sect239k1 [0x8], sect233k1 [0x6], sect233r1 [0x7], secp224k1 [0x14], secp224r1 [0x15], sect193r1 [0x4], sect193r2 [0x5], secp192k1 [0x12], secp192r1 [0x13], sect163k1 [0x1], sect163r1 [0x2], sect163r2 [0x3], secp160k1 [0xF], secp160r1 [0x10], secp160r2 [0x11]
SessionTicket empty
Ciphers: 
[0004] SSL_RSA_WITH_RC4_128_MD5
[0005] SSL_RSA_WITH_RC4_128_SHA
[002F] TLS_RSA_AES_128_SHA
[0035] TLS_RSA_AES_256_SHA
[C002] TLS_ECDH_ECDSA_WITH_RC4_128_SHA
[C004] TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
[C005] TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
[C00C] TLS_ECDH_RSA_WITH_RC4_128_SHA
[C00E] TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
[C00F] TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
[C007] TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
[C009] TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
[C00A] TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
[C011] TLS_ECDHE_RSA_WITH_RC4_128_SHA
[C013] TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA
[C014] TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA
[0033] TLS_DHE_RSA_WITH_AES_128_SHA
[0039] TLS_DHE_RSA_WITH_AES_256_SHA
[0032] TLS_DHE_DSS_WITH_AES_128_SHA
[0038] TLS_DHE_DSS_WITH_AES_256_SHA
[000A] SSL_RSA_WITH_3DES_EDE_SHA
[C003] TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
[C00D] TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
[C008] TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
[C012] TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
[0016] SSL_DHE_RSA_WITH_3DES_EDE_SHA
[0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA
[0009] SSL_RSA_WITH_DES_SHA
[0015] SSL_DHE_RSA_WITH_DES_SHA
[0012] SSL_DHE_DSS_WITH_DES_SHA
[0003] SSL_RSA_EXPORT_WITH_RC4_40_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


Compression: 
[00] NO_COMPRESSION


收到的response:

Encrypted HTTPS traffic flows through this CONNECT tunnel. HTTPS Decryption is enabled in Fiddler, so decrypted sessions running in this tunnel will be shown in the Web Sessions list.


Secure Protocol: Tls
Cipher: Aes128 128bits
Hash Algorithm: Sha1 160bits
Key Exchange: ECDHE_RSA (0xae06) 256bits


== Server Certificate ==========
[Subject]
  CN=sunwei, OU=nut, O=ZIZAIKEJI, L=Beijing, S=Beijing, C=CN


[Issuer]
  CN=sunwei, OU=nut, O=ZIZAIKEJI, L=Beijing, S=Beijing, C=CN


[Serial Number]
  7A09AFA7


[Not Before]
  2013/9/9 14:16:31


[Not After]
  2023/9/7 14:16:31


[Thumbprint]
  64BFEF57FE9A4EA21EB3D5DEC3F1835998D95791

然后才发送真正的HTTPS请求:

# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
8 200 HTTPS api.demo.com /api/v1/demo/find.json 80 application/json;charset=UTF-8
这个请求就是后台api里的请求,没有什么特别的。

然而有的手机使用fiddler做代理却不能发送请求,第一个请求的时候,request里Inspectors里却是:

After the client received notice of the established CONNECT, it failed to send any data.


然后response里没有数据。

这里我不明白的是,为什么移动app发送HTTPS请求的时候,在Fiddler里面会捕捉到两条请求,第一条是HTTP请求,第二条是HTTPS请求,有的手机第一条请求能发送数据,而有的手机却不能发送第一条。这样导致第二条真正的请求发不过去,没法使用Fiddler进行app调试。请高手指教。


加载中
0
千斤难买春秋醉
千斤难买春秋醉

https的端口是443

Tunnel to api.demo.com:443
这个估计是fiddler做的事

0
奋斗。
这个问题解决了吗  请问
c
coolcao
没有解决,不知道咋回事
0
d
dylandong
这个问题解决了吗  请问
0
z
zcsky027
http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForAndroid     需要下载证书
雷神雨石
雷神雨石
回头试试
0
孤零落叶寒
孤零落叶寒
static function OnBeforeResponse(oSession: Session) {
        if (m_Hide304s && oSession.responseCode == 304) {
            oSession["ui-hide"] = "true";
        }
        if (oSession.oRequest["User-Agent"].indexOf("MIUI")> -1 && oSession.HTTPMethodIs("CONNECT")) 
            {oSession.oResponse.headers["Connection"] = "Keep-Alive"; }
    }

加入的

if (oSession.oRequest["User-Agent"].indexOf("MIUI")> -1 && oSession.HTTPMethodIs("CONNECT")) 
            {oSession.oResponse.headers["Connection"] = "Keep-Alive"; }

解决的,我手机是小米,所以判断的ua



孤零落叶寒
孤零落叶寒
回复 @imbaCode : 下载FiddlerScript,可以编写Fiddler脚本
imbaCode
imbaCode
什么意思 没搞懂
0
孤零落叶寒
孤零落叶寒
回复 @imbaCode : 再说一种方法,但说不定能不能成功,你先测试下访问网址https跟http的区别,如果一样,你在OnBeforeRequest方法中
if(oSession.url.StartsWith("https://")){
   oSession.url=oSession.url.Replace("https://","http");
  }




加一段这个,就是把https开头的替换成http了
返回顶部
顶部