Python - requests.exceptions.SSLError - dh key too small

前端 未结 7 908
梦如初夏
梦如初夏 2020-12-08 14:21

I\'m scraping some internal pages using Python and requests. I\'ve turned off SSL verifications and warnings.

requests.packages.urllib3.disable_warnings()
p         


        
7条回答
  •  余生分开走
    2020-12-08 15:19

    Someone from the requests python library's core development team has documented a recipe to keep the changes limited to one or a few servers:

    https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/

    If your code interacts with multiple servers, it makes sense not to lower the security requirements of all connections because one server has a problematic configuration.

    The code worked for me out of the box. That is, using my own value for CIPHERS, 'ALL:@SECLEVEL=1'.

提交回复
热议问题