h2csmuggler icon indicating copy to clipboard operation
h2csmuggler copied to clipboard

Fixed SSL wrap_socket compatibility for Python 3.13

Open Santosh-Baliarsingh opened this issue 2 months ago • 0 comments

Summary

Python 3.13 removed ssl.wrap_socket, causing AttributeError when running h2csmuggler.

Fix

Replaced:

retSock = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLS)

with

context = ssl.SSLContext(ssl.PROTOCOL_TLS)
retSock = context.wrap_socket(sock, server_hostname=proxy_url.hostname)

Santosh-Baliarsingh avatar Oct 27 '25 15:10 Santosh-Baliarsingh