Skip to content

Defer hostname check to OTP when supported#2805

Merged
ferd merged 2 commits intoerlang:mainfrom
ferd:otp-hostname-check
Jul 6, 2023
Merged

Defer hostname check to OTP when supported#2805
ferd merged 2 commits intoerlang:mainfrom
ferd:otp-hostname-check

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