Python Forum
Need to Verify URLs; getting SSLError - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Need to Verify URLs; getting SSLError (/thread-20578.html)



Need to Verify URLs; getting SSLError - rahul_goswami - Aug-20-2019

Hi Team,

I am trying to verify URLs using urllib3 library.
For secure URLs, using 'https://'. I am getting a ststus code of 403.

when the URL is 'http://google.com'

>>> import urllib3
>>> http = urllib3.PoolManager()
>>> r = http.request('GET', 'http://google.com')
>>> r.status
403
when the URL is 'https://google.com'
>>> import urllib3
>>> http = urllib3.PoolManager()
>>> r = http.request('GET', 'https://google.com')
Error:
raise MaxRetryError(_pool, url, error or ResponseError(cause)) MaxRetryError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:833)'),))
Could you please guide in this.