用 Python 下载公开课视频 提示 EOF occurred in violation of protocol 是 GFW 在捣乱? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
coiby
V2EX    问与答

用 Python 下载公开课视频 提示 EOF occurred in violation of protocol 是 GFW 在捣乱?

  •  
  •   coiby 2015-06-04 21:31:53 +08:00 842 次点击

    这是一个创建于 3789 天前的主题,其中的信息可能已经有所发展或是发生改变。

    改写了一个公开课edX程序(实现从CDN cloudfront下载,从而避免翻墙,地址: https://github.com/Coiby/edx-downloader ),最近无法下载课程视频了,提示:
    error: SSLError(8, '_ssl.c:510: EOF occurred in violation of protocol')

    如果走VPS代理,就能正常下载了(比如视频地址 https://d2f1egay8yehza.cloudfront.net/MCGBDYXX/MCGBDYXXT115-V012000_DTH.mp4)。

    请问下熟悉这领域的高手,这是GFW在作恶吗?如何判断?有什么解决方法?谢谢!

    附上更多测试结果:

    1. 不走代理用wget下,提示:
      Resolving d2f1egay8yehza.cloudfront.net (d2f1egay8yehza.cloudfront.net)... 54.182.7.50, 54.182.2.187, 54.182.3.101, ...
      Connecting to d2f1egay8yehza.cloudfront.net(d2f1egay8yehza.cloudfront.net)|54.182.7.50|:443... connected.
      Unable to establish SSL connection.

    2. 用openssl(openssl s_client -connect d2f1egay8yehza.cloudfront.net:443 -tls1_2)得到的信息是:
      ```
      CONNECTED(00000003)

      140235657782944:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:598:

      no peer certificate available

      No client certificate CA names sent

      SSL handshake has read 0 bytes and written 0 bytes

      New, (NONE), Cipher is (NONE)
      Secure Renegotiation IS NOT supported
      Compression: NONE
      Expansion: NONE
      SSL-Session:
      Protocol : TLSv1.2
      Cipher : 0000
      Session-ID:
      Session-ID-ctx:
      Master-Key:
      Key-Arg : None
      PSK identity: None
      PSK identity hint: None
      SRP username: None
      Start Time: 1433423574
      Timeout : 7200 (sec)

      Verify return code: 0 (ok)

       
    3. 如果走代理,执行上面的(openssl s_client -connect d2f1egay8yehza.cloudfront.net:443 -tls1_2)则是:
      ```
      CONNECTED(00000003)
      depth=2 C = US, O = "VeriSign, Inc.", OU = VeriSign Trust Network, OU = "(c) 2006 VeriSign, Inc. - For authorized use only", CN = VeriSign Class 3 Public Primary Certification Authority - G5
      verify error:num=20:unable to get local issuer certificate

      verify return:0

      Certificate chain
      0 s:/C=US/ST=Washington/L=Seattle/O=Amazon.com, Inc./CN=*.cloudfront.net
      i:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 Secure Server CA - G3
      1 s:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 Secure Server CA - G3
      i:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5
      2 s:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5

      i:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority

      Server certificate
      -----BEGIN CERTIFICATE-----
      ...省略
      -----END CERTIFICATE-----
      subject=/C=US/ST=Washington/L=Seattle/O=Amazon.com, Inc./CN=*.cloudfront.net

      issuer=/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 Secure Server CA - G3

      No client certificate CA names sent

      SSL handshake has read 4727 bytes and written 421 bytes

      New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
      Server public key is 2048 bit
      Secure Renegotiation IS supported
      Compression: NONE
      Expansion: NONE
      SSL-Session:
      ....省略
      Start Time: 1433423644
      Timeout : 7200 (sec)

      Verify return code: 20 (unable to get local issuer certificate)

       
    2 条回复    2015-06-08 20:32:36 +08:00
    402645707
        1
    402645707  
       2015-06-05 16:58:38 +08:00 via Android
    cf貌似在大陆的cdn几乎天天抽风被ban
    lz可以试试香港的服务器
    coiby
        2
    coiby  
    OP
       2015-06-08 20:32:36 +08:00
    @402645707 多谢回复!
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2642 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 14:29 PVG 22:29 LAX 07:29 JFK 10:29
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86