When sending a request to a specific URL I get an SSL error and I am not sure why. First please see the error message I am presented with:
requests.exceptions.SSLError: HTTPSConnectionPool(host='dicmedia.korean.go.kr', port=443): Max retries exceeded with url: /multimedia/naver/2016/40000/35000/14470_byeon-gyeong.wav (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))
I searched unsuccessfully to different Stackoverflow questions for the last two days:
I already tried:
- https://github.com/Unbabel/COMET/issues/29 (This seems to be related with an internal update Python received relating to the use of specific SSL certificates (not an expert here)
- Downloading the certificate in question and directly linking to it with
verify="private/etc/ssl/certs"
I am honestly at loss why I receive this error. As the error message itself indicates it seems that the server in question could get my local certificates somehow. The script worked until a week before. I did not update Python before then. Right now I use python 3.10.2 downloaded from the official website.
I don't want to set verify=False
as this just skips the verification process and leaves me vulnerable as numerous people already pointed out at different questions. Besides that it really bothers me that I can't resolve the error.
Any help is much appreciated. See the specific request:
import requests
def request(url):
response = requests.get(url, verify="/private/etc/ssl/certs")
print(response)
request("https://dicmedia.korean.go.kr/multimedia/naver/2016/40000/35000/14470_byeon-
gyeong.wav")