Lines Matching refs:client_context

308     client_context, server_context, hostname = testing_context()
319 client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
320 client_context.load_verify_locations(SIGNING_CA)
327 return client_context, server_context, hostname
1135 client_context, server_context, hostname = testing_context()
1138 with client_context.wrap_socket(socket.socket(),
2367 client_context, server_context, hostname = testing_context()
2372 sslobj = client_context.wrap_bio(incoming, outgoing,
2831 def server_params_test(client_context, server_context, indata=b"FOO\n",
2843 with client_context.wrap_socket(socket.socket(),
2904 client_context = ssl.SSLContext(client_protocol)
2905 client_context.options |= client_options
2925 if client_context.protocol == ssl.PROTOCOL_TLS:
2926 client_context.set_ciphers("ALL")
2928 seclevel_workaround(server_context, client_context)
2930 for ctx in (client_context, server_context):
2935 stats = server_params_test(client_context, server_context,
2964 client_context, server_context, hostname = testing_context()
2967 server_params_test(client_context=client_context,
2972 client_context.check_hostname = False
2975 server_params_test(client_context=server_context,
2976 server_context=client_context,
2986 server_params_test(client_context=server_context,
2996 server_params_test(client_context=server_context,
2997 server_context=client_context,
3007 client_context, server_context, hostname = testing_context()
3010 with client_context.wrap_socket(socket.socket(),
3043 client_context, server_context, hostname = testing_context()
3046 self.assertEqual(client_context.verify_flags, ssl.VERIFY_DEFAULT | tf)
3051 with client_context.wrap_socket(socket.socket(),
3058 client_context.verify_flags |= ssl.VERIFY_CRL_CHECK_LEAF
3062 with client_context.wrap_socket(socket.socket(),
3069 client_context.load_verify_locations(CRLFILE)
3073 with client_context.wrap_socket(socket.socket(),
3083 client_context, server_context, hostname = testing_context()
3088 with client_context.wrap_socket(socket.socket(),
3097 with client_context.wrap_socket(socket.socket(),
3110 client_context.wrap_socket(s)
3116 client_context, server_context, hostname = testing_context()
3117 assert client_context.hostname_checks_common_name
3118 client_context.hostname_checks_common_name = False
3123 with client_context.wrap_socket(socket.socket(),
3127 client_context, server_context, hostname = testing_context(NOSANFILE)
3128 client_context.hostname_checks_common_name = False
3131 with client_context.wrap_socket(socket.socket(),
3137 client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
3138 client_context.load_verify_locations(SIGNING_CA)
3139 client_context.set_ciphers('ECDHE:ECDSA:!NULL:!aRSA')
3149 with client_context.wrap_socket(socket.socket(),
3158 client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
3159 client_context.load_verify_locations(SIGNING_CA)
3162 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
3164 client_context.set_ciphers('ECDHE:ECDSA:!NULL:!aRSA')
3175 with client_context.wrap_socket(socket.socket(),
3245 client_context, server_context, hostname = testing_context()
3247 client_context.load_cert_chain(CERTFILE)
3251 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
3258 client_context.wrap_socket(socket.socket(),
3278 client_context, server_context, hostname = testing_context()
3280 client_context.load_cert_chain(CERTFILE)
3283 client_context.minimum_version = ssl.TLSVersion.TLSv1_3
3289 client_context.wrap_socket(socket.socket(),
3900 client_context, server_context, hostname = testing_context()
3902 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
3904 client_context.set_ciphers("AES128")
3907 with client_context.wrap_socket(socket.socket(),
3934 client_context, server_context, hostname = testing_context()
3935 client_context.minimum_version = ssl.TLSVersion.TLSv1_3
3937 with client_context.wrap_socket(socket.socket(),
3951 client_context, server_context, hostname = testing_context()
3953 client_context.minimum_version = ssl.TLSVersion.TLSv1
3954 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
3960 with client_context.wrap_socket(socket.socket(),
3968 client_context, server_context, hostname = testing_context()
3970 client_context.minimum_version = ssl.TLSVersion.TLSv1
3971 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
3974 seclevel_workaround(client_context, server_context)
3977 with client_context.wrap_socket(socket.socket(),
3986 client_context, server_context, hostname = testing_context()
3990 client_context.maximum_version = ssl.TLSVersion.TLSv1
3991 client_context.minimum_version = ssl.TLSVersion.TLSv1
3992 seclevel_workaround(client_context, server_context)
3995 with client_context.wrap_socket(socket.socket(),
4003 client_context, server_context, hostname = testing_context()
4005 client_context.minimum_version = ssl.TLSVersion.SSLv3
4006 client_context.maximum_version = ssl.TLSVersion.SSLv3
4007 seclevel_workaround(client_context, server_context)
4010 with client_context.wrap_socket(socket.socket(),
4018 client_context, server_context, hostname = testing_context()
4021 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
4027 with client_context.wrap_socket(socket.socket(),
4039 client_context, server_context, hostname = testing_context()
4046 with client_context.wrap_socket(
4070 with client_context.wrap_socket(
4093 client_context, server_context, hostname = testing_context()
4094 stats = server_params_test(client_context, server_context,
4104 client_context, server_context, hostname = testing_context()
4105 client_context.options |= ssl.OP_NO_COMPRESSION
4107 stats = server_params_test(client_context, server_context,
4115 client_context, server_context, hostname = testing_context()
4117 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
4121 stats = server_params_test(client_context, server_context,
4131 client_context, server_context, hostname = testing_context()
4136 stats = server_params_test(client_context, server_context,
4141 client_context, server_context, hostname = testing_context()
4142 client_context.set_ecdh_curve("secp384r1")
4145 stats = server_params_test(client_context, server_context,
4150 client_context, server_context, hostname = testing_context()
4151 client_context.set_ecdh_curve("prime256v1")
4156 server_params_test(client_context, server_context,
4162 client_context, server_context, hostname = testing_context()
4163 stats = server_params_test(client_context, server_context,
4170 client_context, server_context, hostname = testing_context()
4172 stats = server_params_test(client_context, server_context,
4186 client_context, server_context, hostname = testing_context()
4188 client_context.set_alpn_protocols(client_protocols)
4191 stats = server_params_test(client_context,
4219 client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
4220 client_context.load_verify_locations(SIGNING_CA)
4221 return server_context, other_context, client_context
4229 server_context, other_context, client_context = self.sni_contexts()
4231 client_context.check_hostname = False
4239 stats = server_params_test(client_context, server_context,
4250 stats = server_params_test(client_context, server_context,
4260 stats = server_params_test(client_context, server_context,
4269 server_context, other_context, client_context = self.sni_contexts()
4275 stats = server_params_test(client_context, server_context,
4282 server_context, other_context, client_context = self.sni_contexts()
4290 stats = server_params_test(client_context, server_context,
4301 server_context, other_context, client_context = self.sni_contexts()
4309 stats = server_params_test(client_context, server_context,
4318 client_context, server_context, hostname = testing_context()
4319 client_context.set_ciphers("AES128:AES256")
4327 stats = server_params_test(client_context, server_context,
4336 client_context, server_context, hostname = testing_context()
4340 s = client_context.wrap_socket(socket.socket(),
4353 client_context, server_context, hostname = testing_context()
4356 with client_context.wrap_socket(socket.socket(),
4364 client_context, server_context, hostname = testing_context()
4366 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
4369 stats = server_params_test(client_context, server_context,
4383 stats = server_params_test(client_context, server_context,
4397 stats = server_params_test(client_context, server_context,
4408 stats = server_params_test(client_context, server_context,
4421 client_context, server_context, hostname = testing_context()
4425 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
4430 with client_context.wrap_socket(socket.socket(),
4442 with client_context.wrap_socket(socket.socket(),
4451 with client_context.wrap_socket(socket.socket(),
4498 client_context, server_context, hostname = testing_context()
4501 client_context.post_handshake_auth = True
4502 client_context.load_cert_chain(SIGNED_CERTFILE)
4506 with client_context.wrap_socket(socket.socket(),
4523 client_context, server_context, hostname = testing_context()
4526 client_context.post_handshake_auth = True
4534 client_context._msg_callback = msg_cb
4538 with client_context.wrap_socket(socket.socket(),
4563 client_context, server_context, hostname = testing_context()
4566 client_context.post_handshake_auth = True
4567 client_context.load_cert_chain(SIGNED_CERTFILE)
4573 with client_context.wrap_socket(socket.socket(),
4587 client_context, server_context, hostname = testing_context()
4590 client_context.post_handshake_auth = True
4594 with client_context.wrap_socket(socket.socket(),
4606 client_context, server_context, hostname = testing_context()
4609 client_context.load_cert_chain(SIGNED_CERTFILE)
4613 with client_context.wrap_socket(socket.socket(),
4623 client_context, server_context, hostname = testing_context()
4625 client_context.post_handshake_auth = True
4626 client_context.load_cert_chain(SIGNED_CERTFILE)
4630 with client_context.wrap_socket(socket.socket(),
4643 client_context, server_context, hostname = testing_context()
4645 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
4646 client_context.post_handshake_auth = True
4647 client_context.load_cert_chain(SIGNED_CERTFILE)
4651 with client_context.wrap_socket(socket.socket(),
4662 client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
4663 client_context.post_handshake_auth = True
4664 client_context.load_cert_chain(SIGNED_CERTFILE)
4666 client_context.check_hostname = False
4667 client_context.verify_mode = ssl.CERT_NONE
4677 with client_context.wrap_socket(socket.socket(),
4690 client_context, server_context, hostname = testing_context(
4695 with client_context.wrap_socket(
4727 client_context, server_context, hostname = testing_context()
4728 client_context.load_cert_chain(SIGNED_CERTFILE)
4734 with client_context.wrap_socket(
4785 client_context, server_context, hostname = testing_context()
4787 client_context.keylog_filename = os_helper.TESTFN
4790 with client_context.wrap_socket(socket.socket(),
4796 client_context.keylog_filename = None
4800 with client_context.wrap_socket(socket.socket(),
4805 client_context.keylog_filename = os_helper.TESTFN
4809 with client_context.wrap_socket(socket.socket(),
4814 client_context.keylog_filename = None
4837 client_context, server_context, hostname = testing_context()
4842 self.assertIs(client_context._msg_callback, None)
4843 client_context._msg_callback = msg_cb
4844 self.assertIs(client_context._msg_callback, msg_cb)
4846 client_context._msg_callback = object()
4849 client_context, server_context, hostname = testing_context()
4850 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
4860 client_context._msg_callback = msg_cb
4864 with client_context.wrap_socket(socket.socket(),
4880 client_context, server_context, hostname = testing_context()
4894 with client_context.wrap_socket(socket.socket(),
4897 with client_context.wrap_socket(socket.socket(),