don't set an empty ALPN, refs #1772

This commit is contained in:
Maximilian Hils 2016-11-22 17:02:37 +01:00
parent 92516a3b5c
commit 21a03d56b5

View File

@ -503,7 +503,7 @@ class TlsLayer(base.Layer):
if alpn and b"h2" in alpn and not self.config.options.http2: if alpn and b"h2" in alpn and not self.config.options.http2:
alpn.remove(b"h2") alpn.remove(b"h2")
if self.client_conn.ssl_established: if self.client_conn.ssl_established and self.client_conn.connection.get_alpn_proto_negotiated():
# If the client has already negotiated an ALP, then force the # If the client has already negotiated an ALP, then force the
# server to use the same. This can only happen if the host gets # server to use the same. This can only happen if the host gets
# changed after the initial connection was established. E.g.: # changed after the initial connection was established. E.g.: