Skip to content

AttributeError("module 'ssl' has no attribute 'wrap_socket'") #208

@Grovespaz

Description

@Grovespaz

Hello,

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions