make travis install h2, and optionnal import PyOpenSSL

This commit is contained in:
Florent D'halluin 2016-04-05 21:26:44 +02:00
parent 6e3c69eaf7
commit 0c9cd481f6
2 changed files with 4 additions and 2 deletions

View File

@ -5,5 +5,5 @@ python:
- "3.5"
install:
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install unittest2; fi
- pip install asgiref twisted autobahn
- pip install asgiref twisted autobahn h2
script: if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then python -m unittest2; else python -m unittest; fi

View File

@ -1,6 +1,5 @@
import logging
from twisted.internet import reactor, ssl, endpoints
from OpenSSL import crypto
from .http_protocol import HTTPFactory
@ -49,6 +48,9 @@ class Server(object):
)
if self.ssl_certificate :
from OpenSSL import crypto
with open(self.ssl_certificate, 'r') as f:
cert = crypto.load_certificate(crypto.FILETYPE_PEM, f.read())
with open(self.ssl_key, 'r') as f: