diff options
author | Cory Benfield <lukasaoz@gmail.com> | 2015-04-13 17:51:12 -0400 |
---|---|---|
committer | Cory Benfield <lukasaoz@gmail.com> | 2015-04-13 17:51:12 -0400 |
commit | 0f7b04c24252afc37af8a68c71537de59317b485 (patch) | |
tree | 1786f560bc1892e2614a63f84b3a8d9f792aa2f9 | |
parent | 9d80a765b99ac87a39799d9bf89d37cb1273eea8 (diff) | |
download | pyopenssl-0f7b04c24252afc37af8a68c71537de59317b485.tar.gz |
Test for absent ALPN.
-rw-r--r-- | OpenSSL/test/test_ssl.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py index b611873..a499189 100644 --- a/OpenSSL/test/test_ssl.py +++ b/OpenSSL/test/test_ssl.py @@ -1966,6 +1966,28 @@ class ApplicationLayerProtoNegotiationTests(TestCase, _LoopbackMixin): ) self.assertEqual([(server, [b'http/1.1', b'spdy/2'])], select_args) + else: + # No ALPN. + def test_alpn_not_implemented(self): + # Test the context methods first. + context = Context(TLSv1_METHOD) + fail_methods = [ + context.set_alpn_protos, + context.set_alpn_select_callback, + ] + for method in fail_methods: + self.assertRaises( + NotImplementedError, method, None + ) + + # Now test a connection. + conn = Connection(context) + fail_methods = [ + conn.set_alpn_protos, + ] + for method in fail_methods: + self.assertRaises(NotImplementedError, method) + class SessionTests(TestCase): |