Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated ssl.wrap_socket with SSLContext.wrap_socket #221

Merged

Conversation

StareInTheAir
Copy link
Contributor

@StareInTheAir StareInTheAir commented Dec 25, 2023

  • Update example code in ssl-cat.py
    • Replace deprecated ssl.wrap_socket with SSLContext.wrap_socket
  • Update examples in connection.py docs

ssl.wrap_socket() was also removed in Python 3.12, so this makes ssl-cat.py work with 3.12.

I prefer this fix, but I also have a branch where I changed the library code to directly work with SSLContext.wrap_socket but it's a breaking change, since then ssl.wrap_socket() will no longer work: main...StareInTheAir:irc-fork:feature/ssl-context-wrap-socket-lib
Please let me know if I should open a PR for that branch instead

This PR is backwards compatible since it's only client-side.

Resolves #216

@bswck
Copy link
Contributor

bswck commented Mar 27, 2024

@jaraco

Copy link
Contributor

@bswck bswck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. I had a side observation that ssl-cat.py needs some "ruffing".

@jaraco jaraco closed this Mar 28, 2024
@jaraco jaraco reopened this Mar 28, 2024
@jaraco jaraco closed this Mar 28, 2024
@jaraco jaraco reopened this Mar 28, 2024
@jaraco
Copy link
Owner

jaraco commented Mar 28, 2024

The coverage failures are fine - these lines were added to a script that already wasn't being tested in that code, so I'll ignore the failure. Thanks for the contrib!

@jaraco jaraco merged commit 03f998a into jaraco:main Mar 28, 2024
13 of 14 checks passed
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.

irc.connection.Factory.connect should support ssl.SSLContext.wrap_socket with the server_hostname parameter
3 participants