mirror of
https://github.com/django/daphne.git
synced 2025-07-10 16:02:18 +03:00
make travis install h2, and optionnal import PyOpenSSL
This commit is contained in:
parent
6e3c69eaf7
commit
0c9cd481f6
|
@ -5,5 +5,5 @@ python:
|
||||||
- "3.5"
|
- "3.5"
|
||||||
install:
|
install:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install unittest2; fi
|
- 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
|
script: if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then python -m unittest2; else python -m unittest; fi
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
from twisted.internet import reactor, ssl, endpoints
|
from twisted.internet import reactor, ssl, endpoints
|
||||||
from OpenSSL import crypto
|
|
||||||
|
|
||||||
from .http_protocol import HTTPFactory
|
from .http_protocol import HTTPFactory
|
||||||
|
|
||||||
|
@ -49,6 +48,9 @@ class Server(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.ssl_certificate :
|
if self.ssl_certificate :
|
||||||
|
|
||||||
|
from OpenSSL import crypto
|
||||||
|
|
||||||
with open(self.ssl_certificate, 'r') as f:
|
with open(self.ssl_certificate, 'r') as f:
|
||||||
cert = crypto.load_certificate(crypto.FILETYPE_PEM, f.read())
|
cert = crypto.load_certificate(crypto.FILETYPE_PEM, f.read())
|
||||||
with open(self.ssl_key, 'r') as f:
|
with open(self.ssl_key, 'r') as f:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user