Update server.py

We should ask for upstream cert only if there is:
1) no no_upstream_cert option specified
2) ssl connection to server is established
This commit is contained in:
Eli Shvartsman 2014-04-29 12:41:59 +03:00
parent 1dba379ae9
commit ed91e19e0b

View File

@ -226,7 +226,7 @@ class ConnectionHandler:
else: else:
host = self.server_conn.address.host host = self.server_conn.address.host
sans = [] sans = []
if not self.config.no_upstream_cert or not self.server_conn.ssl_established: if not self.config.no_upstream_cert and self.server_conn.ssl_established:
upstream_cert = self.server_conn.cert upstream_cert = self.server_conn.cert
if upstream_cert.cn: if upstream_cert.cn:
host = upstream_cert.cn.decode("utf8").encode("idna") host = upstream_cert.cn.decode("utf8").encode("idna")