title: Python requests module SSLError(CertificateError("hostname 'x.x.x.x' doesn't match 'x.x.x.x")))
body: <p>I'm using the &quot;requests&quot; module for getting JSON from my web service, using the next code:</p>
  <pre><code>import requests
  import SSL
  
  # With or without this line of code below, the output is the same
  ssl.match_hostname = lambda cert, hostname: True
  
  response = requests.get(&quot;MY_URL&quot;, cert=(&quot;client.pem&quot;, &quot;client-key.pem&quot;), verify=&quot;CAcert.cer&quot;)
  </code></pre>
  <p>When the SSL step seems to fail with the following message:</p>
  <pre><code>HTTPSConnectionPool(host='x.x.x.x', port=443): Max retries exceeded with url: {WEBSERVICE_URL_PATTERN} (Caused by SSLError(CertificateError(&quot;hostname 'x.x.x.x' doesn't match 'x.x.x.x'&quot;)))
  </code></pre>
  <p>I'm using Python 3.10.5 with the latest version of the &quot;requests&quot; module.</p>
  <p>Does anyone know what could cause this kind of error and how to fix it?</p>