diff --git a/libmproxy/proxy/server.py b/libmproxy/proxy/server.py index 2252f6747..c5b99feeb 100644 --- a/libmproxy/proxy/server.py +++ b/libmproxy/proxy/server.py @@ -226,7 +226,7 @@ class ConnectionHandler: else: host = self.server_conn.address.host 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 if upstream_cert.cn: host = upstream_cert.cn.decode("utf8").encode("idna")