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

11,185

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

Share:
11,185
dhythhsba
Author by

dhythhsba

Updated on September 23, 2022

Comments

  • dhythhsba
    dhythhsba over 1 year

    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