Skip to content

Conversation

@JayH5
Copy link
Contributor

@JayH5 JayH5 commented May 1, 2020

Using trio-typing

self.stream, ssl_context=ssl_context, server_hostname=hostname
self.stream,
ssl_context=ssl_context,
server_hostname=hostname.decode("ascii"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This wasn't actually a bug I think because the SSLContext always encodes the hostname:
https://github.com/python/cpython/blob/7b3ab5921fa25ed8b97b6296f97c5c78aacf5447/Lib/ssl.py#L486-L492

...but lot's of things (including the typeshed definitions of the stdlib SSLContext) type the hostname as Optional[str]. And we decode with ascii in the asyncio backend as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds fair enough 👍

Copy link
Contributor

@yeraydiazdiaz yeraydiazdiaz left a comment

Choose a reason for hiding this comment

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

Nice one 👍

@JayH5 JayH5 merged commit be8735b into master May 2, 2020
@JayH5 JayH5 deleted the jamie/trio-typing branch May 2, 2020 08:32
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.

3 participants