Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

requests.exceptions.SSLError: hostname 'boxfwd.com' doesn't match either of 'nycmsk.com', 'www.nycmsk.com'

Very simple example on python:

import requests

c = requests.get(u'https://boxfwd.com').content
print c

And on my local computer all works fine.

But on server I see this error:

requests.exceptions.SSLError: hostname 'boxfwd.com' doesn't match either of 'nycmsk.com', 'www.nycmsk.com'

Why I see this error on server ?

In browser I see certificate to *.boxfwd.com certificate

like image 625
dhythhsba Avatar asked Sep 19 '15 11:09

dhythhsba


1 Answers

It seems that in your server another domain (nycmsk.com) is also hosted and requests picks up that certificate.

Look here for a potential solution: https://2.python-requests.org/en/master/community/faq/#what-are-hostname-doesn-t-match-errors

Also probably duplicate with: using requests with TLS doesn't give SNI support

like image 104
miltos Avatar answered Oct 24 '22 20:10

miltos