Changeset 5357109 in mod_gnutls for test/tests/06_invalid_plaintext
- Timestamp:
- Oct 8, 2020, 3:28:49 PM (2 years ago)
- Branches:
- asyncio, main, master
- Children:
- 83b5bf6
- Parents:
- c26a163
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/tests/06_invalid_plaintext/hooks.py
rc26a163 r5357109 13 13 class TLSRecord: 14 14 header = struct.Struct('!BHH') 15 15 16 def __init__(self, data): 16 17 self.type, self.legacy_proto, self.length = \ … … 48 49 """Send an HTTPS request and then plaintext on the same TCP connection""" 49 50 with contextlib.ExitStack() as stack: 50 s = stack.enter_context(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) 51 s = stack.enter_context( 52 socket.socket(socket.AF_INET, socket.SOCK_STREAM)) 51 53 s.connect((host, port)) 52 54 … … 64 66 buf = bytearray(2048) 65 67 pos = 0 66 while not CRLFin buf:68 while CRLF not in buf: 67 69 received = tls_sock.recv_into(memoryview(buf)[pos:]) 68 70 # If we get 0 it means the connection ended before the
Note: See TracChangeset
for help on using the changeset viewer.