How to use urllib2 to get a webpage using SSLv3 encryption

后端 未结 3 948
甜味超标
甜味超标 2021-01-19 08:40

I\'m using python 2.7 and I\'d like to get the contents of a webpage that requires sslv3. Currently when I try to access the page I get the error SSL23_GET_SERVER_HELLO, and

3条回答
  •  遇见更好的自我
    2021-01-19 09:25

    SSL should be handled automatically as long as you have the SSL libraries installed on your server (i.e. you shouldn't have to specificially add it as a handler)

    http://docs.python.org/library/urllib2.html#urllib2.build_opener
    

    If the Python installation has SSL support (i.e., if the ssl module can be imported), HTTPSHandler will also be added.

    Also, note that urllib and urllib2 have been merged in python 3 so their approach is a little different

提交回复
热议问题