You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running warcprox 2.6.1 under Python 3.21, trying to access https-protected urls through warcprox gives the following error:
2024-12-09 13:18:46,072 66069 ERROR MitmProxyHandler(tid=66699,started=2024-12-09T12:18:46.061680,client=127.0.0.1:39790) warcprox.warcprox.WarcProxyHandler.do_CONNECT(mitmproxy.py:402) problem handling 'CONNECT service.archief.nl:443 HTTP/1.1': AttributeError("module 'ssl' has no attribute 'wrap_socket'")
Apparently (quoting this StackOverflow post) the module-level ssl.wrap_socket() was marked as deprecated in Python 3.7 and fully removed in Python 3.12. One solution is to create a SSLContext using ssl.create_default_context() and use the context instance's .wrap_socket() method.
The text was updated successfully, but these errors were encountered:
I don't know enough about the structure of the project to know whether this is the right (and best) solution, but as a workaround I've changed this code to look like this:
def_transition_to_ssl(self):
certfile=self.server.ca.get_wildcard_cert(self.hostname)
context=ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
# Load the certificate into the contextcontext.load_cert_chain(certfile)
self.request=self.connection=context.wrap_socket(
self.connection, server_side=True)
Hello,
When running warcprox 2.6.1 under Python 3.21, trying to access https-protected urls through warcprox gives the following error:
Apparently (quoting this StackOverflow post) the module-level
ssl.wrap_socket()
was marked as deprecated in Python 3.7 and fully removed in Python 3.12. One solution is to create a SSLContext usingssl.create_default_context()
and use the context instance's .wrap_socket() method.The text was updated successfully, but these errors were encountered: