drbild / sslpsk

Adds TLS-PSK support to the Python ssl package
Apache License 2.0
24 stars 32 forks source link

Add support for Python 3.7 #14

Open drbild opened 5 years ago

drbild commented 5 years ago

Fixes #11

rlaunch commented 3 years ago

In the meantime, this monkey-patch has gotten around the issue with using SSLPSK with Python 3.8+:

import sys
import sslpsk

# Monkey patch for SSLPSK
def _sslobj(sock):
    if (3, 5) <= sys.version_info <= (3, 7):
        return sock._sslobj._sslobj
    else:
        return sock._sslobj
sslpsk.sslpsk._sslobj = _sslobj
rutgerhendriks commented 3 years ago

In the meantime, this monkey-patch has gotten around the issue with using SSLPSK with Python 3.8+:

Thanks for this code snippet, it saved me a bunch of time!

It would be great if (pending inclusion of sslpsk in the stdlib -- grin) this would be released so sslpsk can be used out of the box again on Python 3.7 / 3.8 / .. -- hopeful smile :)