python-mpegdash icon indicating copy to clipboard operation
python-mpegdash copied to clipboard

urlopen doesn't take HTTPS

Open BogdanRusu-03 opened this issue 1 year ago • 1 comments

When I try to open an MPD file from an HTTPS link, urlopen throws the following error:

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)> parse.py:16

I would suggest the following changes in parse.py:

def parse(cls, string_or_url)  ->  **def parse(cls, string_or_url, verifiySSL=false):**
def load_xmldom(cls, string_or_url)  ->  def load_xmldom(cls, string_or_url, verifiySSL)
    ...
    mpd_string = urlopen(string_or_url).read()  -> requests.get(string_or_url, verify=verifiySSL)
    ....

BogdanRusu-03 avatar Jun 13 '24 14:06 BogdanRusu-03

not verifying SSL is bad practice. Make your self-signed certificated trusted.

onovy avatar Jun 13 '24 15:06 onovy