code: def _get_server_cert(self, response):
          
          if self.send_cbt:
              certificate_hash = None
              raw_response = response.raw
  
              if isinstance(raw_response, HTTPResponse):
                  if sys.version_info > (3, 0):
                      socket = raw_response._fp.fp.raw._sock
                  else:
                      socket = raw_response._fp.fp._sock
  
                  try:
                      server_certificate = socket.getpeercert(True)
                  except AttributeError:
                      pass
                  else:
                      certificate_hash = _get_certificate_hash(server_certificate)
              else:
                  warnings.warn(
                      "Requests is running with a non urllib3 backend, cannot retrieve server certificate for CBT",
                      NoCertificateRetrievedWarning)
  
              return certificate_hash
          else:
              return None
docs: Get the certificate at the request_url and return it as a hash. Will get the raw socket from the
          original response from the server. This socket is then checked if it is an SSL socket and then used to
          get the hash of the certificate. The certificate hash is then used with NTLMv2 authentication for
          Channel Binding Tokens support. If the raw object is not a urllib3 HTTPReponse (default with requests)
          then no certificate will be returned.
  
          :param response: The original 401 response from the server
          :return: The hash of the DER encoded certificate at the request_url or None if not a HTTPS endpoint