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

Revise tls upgrade process in newer versions of python #164

Merged
merged 2 commits into from
Sep 8, 2020

Conversation

brianshannan
Copy link
Collaborator

@brianshannan brianshannan commented Sep 8, 2020

Resolves #134

The current process used for tls is deprecated and will be removed in python 3.9. In python 3.7, start_tls was added, which is a cleaner way to do the tls upgrade process than what is currently implemented. This requires manually creating the stream reader/writer from a transport and protocol, but it isn't that hard to do. I left the previous method for python 3.5 and 3.6, as start_tls wasn't present for those versions.

Additionally, the allow_failures section of the ci config doesn't actually run those configurations, it just allows failures, so they must be run in the main section. Because of this, python 3.6 and 3.8 weren't being run in ci. I made 3.8 non-optional but left 3.6 as optional, as the tests use an api introduced in 3.7, and an exception class for tls hostname mismatches appears to be different in 3.6.

@wallyqs

@wallyqs
Copy link
Member

wallyqs commented Sep 8, 2020

LGTM! 💯 Also confirmed this fixes the issues with uvloop and tls.

python3.7 examples/nats-pub -s tls://demo.nats.io:4443 hello -d world
python3.7 examples/nats-sub -s tls://demo.nats.io:4443 hello

(For some reason when using uvloop now I get this error returning true from eof_received() has no effect when using ssl). Also re: allow_failures 3.6 maybe we can add a skip for those tests for now. Thanks!

@wallyqs wallyqs merged commit 3f47980 into nats-io:master Sep 8, 2020
@wallyqs wallyqs mentioned this pull request Sep 9, 2020
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.

Revise TLS usage for asyncio 3.9 (deprecation warning)
2 participants