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

SSL improvements #5716

Merged
merged 5 commits into from
Dec 15, 2021
Merged

SSL improvements #5716

merged 5 commits into from
Dec 15, 2021

Conversation

timhawes
Copy link

Documentation fixed for wrap_socket (indentation to place it under the correct class, and added the self argument).

SSLContext.wrap_socket now accepts server_hostname=None (the default value). This previously returned an error (TypeError: Can't convert 'NoneType' object to str implicitly).

Implemented the server_hostname argument which was previously ignored. This is done by giving the SSLSocket it's own copy of the ESP-TLS config structure so that we can set the common_name value within it.

Implemented the check_hostname property, load_verify_locations() and set_default_verify_paths() methods on SSLContext. These are based on the documented CPython interfaces.

@timhawes timhawes marked this pull request as ready for review December 14, 2021 01:11
@ladyada
Copy link
Member

ladyada commented Dec 14, 2021

thanks! :)

gregoberfield
gregoberfield previously approved these changes Dec 14, 2021
Copy link

@gregoberfield gregoberfield left a comment

Choose a reason for hiding this comment

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

Looks good to me, adding in the SSL Context functions.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Two minor suggestions. Thanks for following the CPython API!

ports/espressif/common-hal/ssl/SSLContext.c Outdated Show resolved Hide resolved
ports/espressif/common-hal/ssl/SSLContext.c Outdated Show resolved Hide resolved
@timhawes timhawes changed the base branch from main to 7.1.x December 14, 2021 19:10
@timhawes timhawes dismissed gregoberfield’s stale review December 14, 2021 19:10

The base branch was changed.

@timhawes timhawes changed the base branch from 7.1.x to main December 14, 2021 19:10
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit d50079c into adafruit:main Dec 15, 2021
@timhawes timhawes deleted the ssl_improvements branch December 15, 2021 20:43
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.

5 participants