Lines Matching defs:client
19 import http.client
676 """Check that trying to use the given client certificate fails"""
1976 client = client_ctx.wrap_bio(c_in, c_out, server_hostname=hostname)
1982 client.do_handshake()
1994 client.do_handshake()
2000 client.unwrap()
2002 # But server.unwrap() does not raise, because it reads the client's
2007 # And now that the client gets the server's close-notify, it doesn't
2010 client.unwrap()
2499 sys.stdout.write(" client cert is " + pprint.pformat(cert) + "\n")
2503 sys.stdout.write(" client did not provide a cert\n")
2553 sys.stdout.write(" server: client closed connection\n")
2559 sys.stdout.write(" server: read STARTTLS from client, sending OK...\n")
2566 sys.stdout.write(" server: read ENDTLS from client, sending OK...\n")
2574 sys.stdout.write(" server: read CB tls-unique from client, sending our CB data...\n")
2756 sys.stdout.write(" server: read %s from client\n" % repr(data))
2835 Launch a server, connect a client to it and try various reads
2850 " client: sending %r...\n" % indata)
2855 sys.stdout.write(" client: read %r\n" % outdata)
2864 sys.stdout.write(" client: closing connection.\n")
2922 # NOTE: we must enable "ALL" ciphers on the client, otherwise an
2923 # SSLv23 client will send an SSLv3 hello (rather than SSLv2)
2960 """Basic test of an SSL client connecting to a server"""
2966 with self.subTest(client=ssl.PROTOCOL_TLS_CLIENT, server=ssl.PROTOCOL_TLS_SERVER):
2973 with self.subTest(client=ssl.PROTOCOL_TLS_SERVER, server=ssl.PROTOCOL_TLS_CLIENT):
2980 'Cannot create a client socket with a PROTOCOL_TLS_SERVER context',
2984 with self.subTest(client=ssl.PROTOCOL_TLS_SERVER, server=ssl.PROTOCOL_TLS_SERVER):
2990 'Cannot create a client socket with a PROTOCOL_TLS_SERVER context',
2994 with self.subTest(client=ssl.PROTOCOL_TLS_CLIENT, server=ssl.PROTOCOL_TLS_CLIENT):
3000 'Cannot create a client socket with a PROTOCOL_TLS_SERVER context',
3240 """Connecting when the server rejects the client's certificate
3243 connect to it with a wrong client certificate fails.
3246 # load client cert that is not signed by trusted CA
3248 # require TLS client authentication
3279 # load client cert that is not signed by trusted CA
3297 # TLS 1.3 perform client cert exchange after handshake
3305 in the client when attempting handshake.
3369 """Connecting to an SSLv2 server with various client options"""
3379 # SSLv23 client with specific SSL options
3386 """Connecting to an SSLv23 server with various client options"""
3396 " SSL2 client to SSL23 server test unexpectedly failed:\n %s\n"
3429 """Connecting to an SSLv3 server with various client options"""
3443 """Connecting to a TLSv1 server with various client options"""
3458 """Connecting to a TLSv1.1 server with various client options.
3476 """Connecting to a TLSv1.2 server with various client options.
3516 " client: sending %r...\n" % indata)
3528 " client: read %r from server, starting TLS...\n"
3536 " client: read %r from server, ending TLS...\n"
3543 " client: read %r from server\n" % msg)
3545 sys.stdout.write(" client: closing connection.\n")
3575 " client: read %d bytes from remote server '%s'\n"
3593 " client: sending %r...\n" % indata)
3597 sys.stdout.write(" client: read %r\n" % outdata)
3605 sys.stdout.write(" client: closing connection.\n")
3608 sys.stdout.write(" client: connection closed.\n")
3868 client = client_ctx.wrap_socket(
3871 client.connect((hostname, port))
3872 client.send(b'data')
3873 client.recv()
3874 client_addr = client.getsockname()
3875 client.close()
3903 # Force different suites on client and server
3952 # client TLSv1.0 to 1.2
3969 # client 1.0 to 1.2, server 1.0 to 1.1
3987 # client 1.0, server 1.2 (mismatch)
4130 # server secp384r1, client auto
4140 # server auto, client secp384r1
4149 # server / client curve mismatch
4169 # selected_alpn_protocol() is None unless ALPN is used by the client.
4205 msg % (client_result, "client"))
4268 # Returning a TLS alert is reflected to the connecting client
4601 # optional doesn't fail when client does not have a cert
4665 # no cert validation and CA on client side
4995 with socket.socket() as client:
4996 client.connect(server.listener.getsockname())
4998 set_socket_so_linger_on_with_zero_timeout(client)
4999 client.setblocking(False)
5002 client.send(b"DELETE /data HTTP/1.0\r\n\r\n")
5003 client.close() # RST
5038 with socket.socket() as client:
5039 client.connect(server.listener.getsockname())
5045 client, server_hostname="localhost")
5068 class SynchronizedHTTPSConnection(http.client.HTTPSConnection):
5070 http.client.HTTPConnection.connect(self)