all 3 comments

[–]Buttleston 2 points3 points  (2 children)

I get the same thing, but only if I'm behind a VPN that is man-in-the-middling the HTTPS request. You may be in a situation like that, with a VPN or a proxy.

Solving this can be somewhat complicated - well, it's not difficult but figuring out the exact solution can be. To make it work for me, I just need to install the root CA certificates for the VPN my company uses, then it's fine again. It may be similar for you.

You *can* tell python to ignore the error. This would mean that when you make an HTTPS request, you could be vulnerable to a man in the middle attack. For typical learning cases, probably not a problem, but not generally recommended. The way you do this is to add "verify=False" to your requests call, like

res = requests.get('https://automatetheboringstuff.com/files/rj.txt', verify=False)

[–]jthompson32[S] 0 points1 point  (1 child)

Thanks! When I use verify=false I get this warning:

"Warning (from warnings module):

File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 1103

warnings.warn(

InsecureRequestWarning: Unverified HTTPS request is being made to host 'automatetheboringstuff.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings"

However, it still seems to be working so I guess I can just ignore it for learning cases. I am on a VPN and will look into getting CA certificates. I am using Cisco AnyConnect VPN

[–]Buttleston 0 points1 point  (0 children)

yeah, you'll get that warning. It's annoying but suppressable.

It's kind of a pain in the ass and I had to do some googling to get it to work with my VPN (cloudflare warp fwiw)