python requests https 访问出错
错误提示:
/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:100: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
解决办法:
You only need to install the security package extras (thanks @admdrew for pointing it out)
$ pip install requests[security]or, install them directly:
$ pip install pyopenssl ndg-httpsclient pyasn1Requests will then automatically inject pyopenssl into urllib3
If you're on ubuntu, you may run into trouble installing pyopenssl, you'll need these dependencies:
$ apt-get install libffi-dev libssl-dev
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号