Skip to content

Fix compatibility with Python 3.13 (ssl.wrap_socket) and expired certs - #1

Open
pedrocovisi wants to merge 1 commit into
starius:descriptor-wallersfrom
pedrocovisi:descriptor-wallers
Open

Fix compatibility with Python 3.13 (ssl.wrap_socket) and expired certs#1
pedrocovisi wants to merge 1 commit into
starius:descriptor-wallersfrom
pedrocovisi:descriptor-wallers

Conversation

@pedrocovisi

Copy link
Copy Markdown

Hi!

I encountered a crash when trying to run EPS on Python 3.13 (Windows).
The issue is that ssl.wrap_socket was deprecated and has been completely removed in Python 3.12+, causing an AttributeError.

Changes in this PR:

  1. Refactored SSL Context: Updated electrumpersonalserver/server/common.py to use ssl.SSLContext and context.wrap_socket, which is the modern, compatible way to handle SSL connections in newer Python versions.
  2. Added 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 the cryptography library to generate valid, up-to-date self-signed certificates for localhost.

How to test:

  1. Run python fix_cert.py to generate new cert.crt and cert.key.
  2. Configure config.ini to point to these new files.
  3. Run the server normally on Python 3.13+.

This fixes the "listening" issue where the server would crash or fail to accept connections from Electrum Wallet due to SSL handshake failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant