(listener: socket.socket)
| 223 | client_certs = [] |
| 224 | |
| 225 | def socket_handler(listener: socket.socket) -> None: |
| 226 | sock = listener.accept()[0] |
| 227 | sock = self._wrap_in_ssl(sock) |
| 228 | |
| 229 | client_certs.append(sock.getpeercert()) |
| 230 | |
| 231 | data = b"" |
| 232 | while not data.endswith(b"\r\n\r\n"): |
| 233 | data += sock.recv(8192) |
| 234 | |
| 235 | sock.sendall( |
| 236 | b"HTTP/1.1 200 OK\r\n" |
| 237 | b"Server: testsocket\r\n" |
| 238 | b"Connection: close\r\n" |
| 239 | b"Content-Length: 6\r\n" |
| 240 | b"\r\n" |
| 241 | b"Valid!" |
| 242 | ) |
| 243 | |
| 244 | done_receiving.wait(5) |
| 245 | sock.close() |
| 246 | |
| 247 | self._start_server(socket_handler) |
| 248 | with HTTPSConnectionPool( |
nothing calls this directly
no test coverage detected