diff --git a/CHANGELOG.md b/CHANGELOG.md index 666cd7d33..20049b0ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ * Correct documentation example for User-Agent header modification (#4997, @jamesyale) * Fix random connection stalls (#5040, @EndUser509) * Add `n` new flow keybind to mitmweb (#5061, @ianklatzco) +* Fix compatibility with BoringSSL (@pmoulton) ## 28 September 2021: mitmproxy 7.0.4 diff --git a/mitmproxy/net/tls.py b/mitmproxy/net/tls.py index 3e9f53bf0..11a1be4d5 100644 --- a/mitmproxy/net/tls.py +++ b/mitmproxy/net/tls.py @@ -157,7 +157,7 @@ def create_proxy_server_context( ip: bytes = ipaddress.ip_address(hostname).packed except ValueError: SSL._openssl_assert( # type: ignore - SSL._lib.X509_VERIFY_PARAM_set1_host(param, hostname.encode(), 0) == 1 # type: ignore + SSL._lib.X509_VERIFY_PARAM_set1_host(param, hostname.encode(), len(hostname.encode())) == 1 # type: ignore ) else: SSL._openssl_assert( # type: ignore