(response)
return app_data
Tries to get the channel binding token as specified in RFC 5929 to pass
        along to the authentication provider. This is usually the SHA256
        hash of the certificate of the HTTPS endpoint appended onto the string
        'tls-server-end-point'.

        If the socket is not an SSL socker or the raw HTTP object is not a
        urllib3 HTTPResponse, then None will be returned and no channel binding
        data is passed onto the auth context

        :param response: The server's response which is used to sniff out the
            server's certificate
        :return: A byte string containing the CBT prefix and cert hash to pass
            onto the auth context
Tries to get the channel binding token as specified in RFC 5929 to pass
        along to the authentication provider. This is usually the SHA256
        hash of the certificate of the HTTPS endpoint appended onto the string
        'tls-server-end-point'.
Tries to get the channel binding token as specified in RFC 5929 to pass along to the authentication provider . This is usually the SHA256 hash of the certificate of the HTTPS endpoint appended onto the string tls - server - end - point .
def _get_cbt_data(response):
        """
        Tries to get the channel binding token as specified in RFC 5929 to pass
        along to the authentication provider. This is usually the SHA256
        hash of the certificate of the HTTPS endpoint appended onto the string
        'tls-server-end-point'.

        If the socket is not an SSL socker or the raw HTTP object is not a
        urllib3 HTTPResponse, then None will be returned and no channel binding
        data is passed onto the auth context

        :param response: The server's response which is used to sniff out the
            server's certificate
        :return: A byte string containing the CBT prefix and cert hash to pass
            onto the auth context
        """
        app_data = None
        raw_response = response.raw

        if isinstance(raw_response, HTTPResponse):
            try:
                socket = raw_response._fp.fp.raw._sock
            except AttributeError as err:
                warning = "Failed to get raw socket for CBT from urllib3 resp: %s" % str(err)
                warnings.warn(warning, NoCertificateRetrievedWarning)

            else:
                try:
                    cert = socket.getpeercert(True)
                except AttributeError:
                    pass
                else:
                    cert_hash = HTTPNegotiateAuth._get_certificate_hash(cert)
                    app_data = b"tls-server-end-point:" + cert_hash
        else:
            warning = "Requests is running with a non urllib3 backend, cannot retrieve server cert for CBT. Raw " \
                      "type: %s" % type(response).__name__
            warnings.warn(warning, NoCertificateRetrievedWarning)

        return app_data
def _get_cbt_data ( response ) : app_data = None raw_response = response . raw if isinstance ( raw_response , HTTPResponse ) : try : socket = raw_response . _fp . fp . raw . _sock except AttributeError as err : warning = "Failed to get raw socket for CBT from urllib3 resp: %s" % str ( err ) warnings . warn ( warning , NoCertificateRetrievedWarning ) else : try : cert = socket . getpeercert ( True ) except AttributeError : pass else : cert_hash = HTTPNegotiateAuth . _get_certificate_hash ( cert ) app_data = b"tls-server-end-point:" + cert_hash else : warning = "Requests is running with a non urllib3 backend, cannot retrieve server cert for CBT. Raw " "type: %s" % type ( response ) . __name__ warnings . warn ( warning , NoCertificateRetrievedWarning ) return app_data