Oct-25-2017, 04:53 PM
Hey guys,
I've been trying to establish an http connection with requests. The problem is that I'm getting an ssl exceptions error:
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.thesite.org', port=443): Max retries exceeded with url: /?msg=login_err (Caused by SSLError(CertificateError("hostname 'www.thesite.org' doesn't match either of '*.webfaction.com', 'webfaction.com'",),))
So the ssl is improperly setup, so I'm not touching it. I've been trying to connect with http.
So far I've tried verify=False... and I get a similar error about exceeding redirects.
Any ideas?
NVM
So if people come across this issue in the future, the answer is to specify the port in the URL.
so the above code will work with the line:
I've been trying to establish an http connection with requests. The problem is that I'm getting an ssl exceptions error:
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.thesite.org', port=443): Max retries exceeded with url: /?msg=login_err (Caused by SSLError(CertificateError("hostname 'www.thesite.org' doesn't match either of '*.webfaction.com', 'webfaction.com'",),))
So the ssl is improperly setup, so I'm not touching it. I've been trying to connect with http.
import requests s = requests.session() url = 'http://www.thesite.org/login.py' data = {'username':'myusername', 'passwd':'mypassword'} s.post(url, data) s.get(url)Is there any way to force the http connection?
So far I've tried verify=False... and I get a similar error about exceeding redirects.
Any ideas?
NVM
So if people come across this issue in the future, the answer is to specify the port in the URL.
so the above code will work with the line:
url = 'http://www.thesite.org/login.py:80'Happy coding