0

I'm trying to download a file with requests

http_response = requests.get(url)

And I keep getting this error

SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1131)'))

Stack says it's a configuration issue with the library and suggests configuring it however I haven't found any solutions that end up working.

Any suggestions on fixing this error? (code was working 2 months ago when I last ran)

tjaqu787
  • 295
  • 2
  • 16

1 Answers1

-1

To get around this problem, the nuclear option is to pass verify=False as part of your requests call:

http_response = requests.get(url, verify=False)

This turns off all verification of SSL certificates.

hd1
  • 33,938
  • 5
  • 80
  • 91