This commit is contained in:
Maximilian Hils
2015-08-28 17:35:48 +02:00
parent de0ced73f8
commit 982d8000c4
4 changed files with 3 additions and 22 deletions

View File

@@ -1,3 +1,2 @@
from . import *
from exceptions import *
from semantics import *

View File

@@ -34,9 +34,7 @@ class HTTP2Protocol(semantics.ProtocolMixin):
HTTP_1_1_REQUIRED=0xd
)
# "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
CLIENT_CONNECTION_PREFACE =\
'505249202a20485454502f322e300d0a0d0a534d0d0a0d0a'.decode('hex')
CLIENT_CONNECTION_PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
ALPN_PROTO_H2 = 'h2'

View File

@@ -23,28 +23,12 @@ EINTR = 4
# To enable all SSL methods use: SSLv23
# then add options to disable certain methods
# https://bugs.launchpad.net/pyopenssl/+bug/1020632/comments/3
# Use ONLY for parsing of CLI arguments!
# All code internals should use OpenSSL constants directly!
SSL_VERSIONS = {
'TLSv1.2': SSL.TLSv1_2_METHOD,
'TLSv1.1': SSL.TLSv1_1_METHOD,
'TLSv1': SSL.TLSv1_METHOD,
'SSLv3': SSL.SSLv3_METHOD,
'SSLv2': SSL.SSLv2_METHOD,
'SSLv23': SSL.SSLv23_METHOD,
}
SSL_DEFAULT_VERSION = 'SSLv23'
SSL_DEFAULT_METHOD = SSL_VERSIONS[SSL_DEFAULT_VERSION]
SSL_DEFAULT_METHOD = SSL.SSLv23_METHOD
SSL_DEFAULT_OPTIONS = (
SSL.OP_NO_SSLv2 |
SSL.OP_NO_SSLv3 |
SSL.OP_CIPHER_SERVER_PREFERENCE
)
if hasattr(SSL, "OP_NO_COMPRESSION"):
SSL_DEFAULT_OPTIONS |= SSL.OP_NO_COMPRESSION

View File

@@ -182,7 +182,7 @@ def parse_url(url):
return None
else:
host = netloc
if scheme == "https":
if scheme.endswith("https"):
port = 443
else:
port = 80