Fix compatibility with Python 3.13 (ssl.wrap_socket) and expired certs - #1
Open
pedrocovisi wants to merge 1 commit into
Open
Fix compatibility with Python 3.13 (ssl.wrap_socket) and expired certs#1pedrocovisi wants to merge 1 commit into
pedrocovisi wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
I encountered a crash when trying to run EPS on Python 3.13 (Windows).
The issue is that
ssl.wrap_socketwas deprecated and has been completely removed in Python 3.12+, causing anAttributeError.Changes in this PR:
electrumpersonalserver/server/common.pyto usessl.SSLContextandcontext.wrap_socket, which is the modern, compatible way to handle SSL connections in newer Python versions.fix_cert.py: Since the new SSL method is stricter and the default certificates might be expired or incompatible, I created a small utility script (fix_cert.py) that uses thecryptographylibrary to generate valid, up-to-date self-signed certificates forlocalhost.How to test:
python fix_cert.pyto generate newcert.crtandcert.key.config.inito point to these new files.This fixes the "listening" issue where the server would crash or fail to accept connections from Electrum Wallet due to SSL handshake failures.