Skip to content

Commit 0ceb18a

Browse files
committed
HTTP client: allow to drop channel bindings
1 parent 2199d5d commit 0ceb18a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scapy/layers/http.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ class HTTP_Client(object):
763763
:param ssl: whether to use HTTPS or not
764764
:param ssp: the SSP object to use for binding
765765
:param no_check_certificate: with SSL, do not check the certificate
766+
:param no_chan_bindings: force disable sending the channel bindings
766767
"""
767768

768769
def __init__(
@@ -772,6 +773,7 @@ def __init__(
772773
sslcontext=None,
773774
ssp=None,
774775
no_check_certificate=False,
776+
no_chan_bindings=False,
775777
):
776778
self.sock = None
777779
self._sockinfo = None
@@ -781,6 +783,7 @@ def __init__(
781783
self.ssp = ssp
782784
self.sspcontext = None
783785
self.no_check_certificate = no_check_certificate
786+
self.no_chan_bindings = no_chan_bindings
784787
self.chan_bindings = GSS_C_NO_CHANNEL_BINDINGS
785788

786789
def _connect_or_reuse(self, host, port=None, tls=False, timeout=5):
@@ -823,7 +826,7 @@ def _connect_or_reuse(self, host, port=None, tls=False, timeout=5):
823826
else:
824827
context = self.sslcontext
825828
sock = context.wrap_socket(sock, server_hostname=host)
826-
if self.ssp:
829+
if self.ssp and not self.no_chan_bindings:
827830
# Compute the channel binding token (CBT)
828831
self.chan_bindings = GssChannelBindings.fromssl(
829832
ChannelBindingType.TLS_SERVER_END_POINT,

0 commit comments

Comments
 (0)