diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-05-29 17:04:12 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-05-29 17:04:12 +0200 |
commit | 629fa8e5528783501e402a7e33ac6199bb38ece6 (patch) | |
tree | e9db4d5b1ee750cf96e8bed35b23195d3a5eb631 /test/test_tcp.py | |
parent | c32d8189faa24cbe016bb3c859f64c816e0871fe (diff) | |
download | mitmproxy-629fa8e5528783501e402a7e33ac6199bb38ece6.tar.gz mitmproxy-629fa8e5528783501e402a7e33ac6199bb38ece6.tar.bz2 mitmproxy-629fa8e5528783501e402a7e33ac6199bb38ece6.zip |
make tests aware of ALPN & OpenSSL 1.0.2 dependency
Diffstat (limited to 'test/test_tcp.py')
-rw-r--r-- | test/test_tcp.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/test/test_tcp.py b/test/test_tcp.py index ab786d3f..62617707 100644 --- a/test/test_tcp.py +++ b/test/test_tcp.py @@ -4,11 +4,14 @@ import time import socket import random import os -from netlib import tcp, certutils, test, certffi import threading import mock -import tutils + from OpenSSL import SSL +import OpenSSL + +from netlib import tcp, certutils, test, certffi +import tutils class EchoHandler(tcp.BaseHandler): @@ -399,12 +402,14 @@ class TestALPN(test.ServerTestBase): alpn_select="h2" ) - def test_alpn(self): - c = tcp.TCPClient(("127.0.0.1", self.port)) - c.connect() - c.convert_to_ssl(alpn_protos=["h2"]) - print "ALPN: %s" % c.get_alpn_proto_negotiated() - assert c.get_alpn_proto_negotiated() == "h2" + if OpenSSL._util.lib.Cryptography_HAS_ALPN: + + def test_alpn(self): + c = tcp.TCPClient(("127.0.0.1", self.port)) + c.connect() + c.convert_to_ssl(alpn_protos=["h2"]) + print "ALPN: %s" % c.get_alpn_proto_negotiated() + assert c.get_alpn_proto_negotiated() == "h2" class TestSSLTimeOut(test.ServerTestBase): |