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

Defer hostname check to OTP when supported #2805

Merged
merged 2 commits into from
Jul 6, 2023
Merged

Conversation

ferd
Copy link
Collaborator

@ferd ferd commented Jul 4, 2023

While investigating the work required to support
#2803, I found out that the code was already in place.

However, despite the code being there, we still passed the old ssl_verify_hostname:verify_fun/3 function of pre-21.0 on top of it, which I supposed ignored the check.

So this change reworks the flow such that we fall back to the legacy check only if it isn't supported by the OTP library at this point. Getting this going would require someone to build a new release on an Erlang copy older than OTP-21 (which is no longer supported) which is unlikely.

This follows guidelines from
https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/ssl

While investigating the work required to support
erlang#2803, I found out that the code
was already in place.

However, despite the code being there, we still passed the old
`ssl_verify_hostname:verify_fun/3` function of pre-21.0 on top of it,
which I supposed ignored the check.

So this change reworks the flow such that we fall back to the legacy
check only if it isn't supported by the OTP library at this point.
Getting this going would require someone to build a new release on an
Erlang copy older than OTP-21 (which is no longer supported) which is
unlikely.

This follows guidelines from
https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/ssl
@ferd ferd force-pushed the otp-hostname-check branch from 0667f23 to e408994 Compare July 5, 2023 21:33
@ferd ferd requested a review from tsloughter July 5, 2023 21:41
@ferd ferd merged commit c46bec6 into erlang:main Jul 6, 2023
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.

2 participants