Lines Matching refs:server_context
249 server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
250 server_context.load_cert_chain(server_cert)
251 server_context.load_verify_locations(SIGNING_CA)
253 return client_context, server_context, hostname
2573 def server_params_test(client_context, server_context, indata=b"FOO\n", argument
2581 server = ThreadedEchoServer(context=server_context,
2647 server_context = ssl.SSLContext(server_protocol)
2648 server_context.options |= server_options
2654 and hasattr(server_context, 'minimum_version')
2656 and server_context.minimum_version > min_version):
2659 server_context.minimum_version = min_version
2667 for ctx in (client_context, server_context):
2672 stats = server_params_test(client_context, server_context,
2710 client_context, server_context, hostname = testing_context()
2714 server_context=server_context,
2721 server_params_test(client_context=server_context,
2722 server_context=client_context,
2730 server_params_test(client_context=server_context,
2731 server_context=server_context,
2738 server_params_test(client_context=server_context,
2739 server_context=client_context,
2748 client_context, server_context, hostname = testing_context()
2749 server = ThreadedEchoServer(context=server_context, chatty=False)
2786 client_context, server_context, hostname = testing_context()
2792 server = ThreadedEchoServer(context=server_context, chatty=True)
2803 server = ThreadedEchoServer(context=server_context, chatty=True)
2814 server = ThreadedEchoServer(context=server_context, chatty=True)
2826 client_context, server_context, hostname = testing_context()
2829 server = ThreadedEchoServer(context=server_context, chatty=True)
2838 server = ThreadedEchoServer(context=server_context, chatty=True)
2848 server = ThreadedEchoServer(context=server_context, chatty=True)
2861 server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
2863 server_context.load_cert_chain(SIGNED_CERTFILE_ECC)
2866 server = ThreadedEchoServer(context=server_context, chatty=True)
2886 server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
2888 server_context.load_cert_chain(SIGNED_CERTFILE_ECC)
2889 server_context.load_cert_chain(SIGNED_CERTFILE)
2892 server = ThreadedEchoServer(context=server_context, chatty=True)
2906 server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
2907 server_context.load_cert_chain(IDNSANSFILE)
2940 server = ThreadedEchoServer(context=server_context, chatty=True)
2951 server = ThreadedEchoServer(context=server_context, chatty=True)
2964 client_context, server_context, hostname = testing_context()
2968 server_context.verify_mode = ssl.CERT_REQUIRED
2973 context=server_context, chatty=True, connectionchatty=True,
2997 client_context, server_context, hostname = testing_context()
3000 server_context.verify_mode = ssl.CERT_REQUIRED
3001 server_context.minimum_version = ssl.TLSVersion.TLSv1_3
3005 context=server_context, chatty=True, connectionchatty=True,
3071 server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
3072 server_context.load_cert_chain(SIGNED_CERTFILE)
3076 server = ThreadedEchoServer(context=server_context, chatty=True)
3637 client_context, server_context, hostname = testing_context()
3642 server_context.set_ciphers("AES256")
3643 with ThreadedEchoServer(context=server_context) as server:
3695 client_context, server_context, hostname = testing_context()
3700 server_context.minimum_version = ssl.TLSVersion.TLSv1_2
3701 server_context.maximum_version = ssl.TLSVersion.TLSv1_2
3703 with ThreadedEchoServer(context=server_context) as server:
3710 server_context.minimum_version = ssl.TLSVersion.TLSv1
3711 server_context.maximum_version = ssl.TLSVersion.TLSv1_1
3713 with ThreadedEchoServer(context=server_context) as server:
3720 server_context.minimum_version = ssl.TLSVersion.TLSv1_2
3721 server_context.maximum_version = ssl.TLSVersion.TLSv1_2
3724 with ThreadedEchoServer(context=server_context) as server:
3736 client_context, server_context, hostname = testing_context()
3737 server_context.minimum_version = ssl.TLSVersion.SSLv3
3740 with ThreadedEchoServer(context=server_context) as server:
3773 client_context, server_context, hostname = testing_context()
3775 server = ThreadedEchoServer(context=server_context,
3827 client_context, server_context, hostname = testing_context()
3828 stats = server_params_test(client_context, server_context,
3838 client_context, server_context, hostname = testing_context()
3840 server_context.options |= ssl.OP_NO_COMPRESSION
3841 stats = server_params_test(client_context, server_context,
3848 client_context, server_context, hostname = testing_context()
3851 server_context.load_dh_params(DHFILE)
3852 server_context.set_ciphers("kEDH")
3853 server_context.options |= ssl.OP_NO_TLSv1_3
3854 stats = server_params_test(client_context, server_context,
3866 client_context, server_context, hostname = testing_context()
3868 server_context.set_ecdh_curve("secp384r1")
3869 server_context.set_ciphers("ECDHE:!eNULL:!aNULL")
3870 server_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
3871 stats = server_params_test(client_context, server_context,
3876 client_context, server_context, hostname = testing_context()
3878 server_context.set_ciphers("ECDHE:!eNULL:!aNULL")
3879 server_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
3880 stats = server_params_test(client_context, server_context,
3885 client_context, server_context, hostname = testing_context()
3887 server_context.set_ecdh_curve("secp384r1")
3888 server_context.set_ciphers("ECDHE:!eNULL:!aNULL")
3889 server_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
3891 stats = server_params_test(client_context, server_context,
3903 client_context, server_context, hostname = testing_context()
3904 stats = server_params_test(client_context, server_context,
3912 client_context, server_context, hostname = testing_context()
3913 server_context.set_alpn_protocols(['foo', 'bar'])
3914 stats = server_params_test(client_context, server_context,
3929 client_context, server_context, hostname = testing_context()
3930 server_context.set_alpn_protocols(server_protocols)
3935 server_context,
3961 client_context, server_context, hostname = testing_context()
3962 stats = server_params_test(client_context, server_context,
3977 client_context, server_context, hostname = testing_context()
3978 server_context.set_npn_protocols(server_protocols)
3980 stats = server_params_test(client_context, server_context,
3994 server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
3995 server_context.load_cert_chain(SIGNED_CERTFILE)
4000 return server_context, other_context, client_context
4009 server_context, other_context, client_context = self.sni_contexts()
4017 server_context.set_servername_callback(servername_cb)
4019 stats = server_params_test(client_context, server_context,
4024 self.assertEqual(calls, [("supermessage", server_context)])
4030 stats = server_params_test(client_context, server_context,
4033 self.assertEqual(calls, [(None, server_context)])
4038 server_context.set_servername_callback(None)
4040 stats = server_params_test(client_context, server_context,
4050 server_context, other_context, client_context = self.sni_contexts()
4054 server_context.set_servername_callback(cb_returning_alert)
4056 stats = server_params_test(client_context, server_context,
4064 server_context, other_context, client_context = self.sni_contexts()
4068 server_context.set_servername_callback(cb_raising)
4072 stats = server_params_test(client_context, server_context,
4082 server_context, other_context, client_context = self.sni_contexts()
4086 server_context.set_servername_callback(cb_wrong_return_type)
4090 stats = server_params_test(client_context, server_context,
4097 client_context, server_context, hostname = testing_context()
4099 server_context.set_ciphers("AES256")
4106 stats = server_params_test(client_context, server_context,
4115 client_context, server_context, hostname = testing_context()
4116 server = ThreadedEchoServer(context=server_context, chatty=False)
4145 client_context, server_context, hostname = testing_context()
4150 stats = server_params_test(client_context, server_context,
4160 sess_stat = server_context.session_stats()
4165 stats = server_params_test(client_context, server_context,
4167 sess_stat = server_context.session_stats()
4179 stats = server_params_test(client_context, server_context,
4185 sess_stat = server_context.session_stats()
4190 stats = server_params_test(client_context, server_context,
4198 sess_stat = server_context.session_stats()
4203 client_context, server_context, hostname = testing_context()
4210 server = ThreadedEchoServer(context=server_context, chatty=False)
4280 client_context, server_context, hostname = testing_context()
4281 server_context.post_handshake_auth = True
4282 server_context.verify_mode = ssl.CERT_REQUIRED
4286 server = ThreadedEchoServer(context=server_context, chatty=False)
4305 client_context, server_context, hostname = testing_context()
4306 server_context.post_handshake_auth = True
4307 server_context.verify_mode = ssl.CERT_REQUIRED
4310 server = ThreadedEchoServer(context=server_context, chatty=False)
4330 client_context, server_context, hostname = testing_context()
4331 server_context.post_handshake_auth = True
4332 server_context.verify_mode = ssl.CERT_REQUIRED
4337 server_context.verify_mode = ssl.CERT_OPTIONAL
4338 server = ThreadedEchoServer(context=server_context, chatty=False)
4354 client_context, server_context, hostname = testing_context()
4355 server_context.post_handshake_auth = True
4356 server_context.verify_mode = ssl.CERT_OPTIONAL
4359 server = ThreadedEchoServer(context=server_context, chatty=False)
4373 client_context, server_context, hostname = testing_context()
4374 server_context.post_handshake_auth = True
4375 server_context.verify_mode = ssl.CERT_REQUIRED
4378 server = ThreadedEchoServer(context=server_context, chatty=False)
4390 client_context, server_context, hostname = testing_context()
4391 server_context.verify_mode = ssl.CERT_REQUIRED
4395 server = ThreadedEchoServer(context=server_context, chatty=False)
4410 client_context, server_context, hostname = testing_context()
4411 server_context.verify_mode = ssl.CERT_REQUIRED
4416 server = ThreadedEchoServer(context=server_context, chatty=False)