Skip to content

Skip certificate verification when unsafe_https is set - #1263

Merged
ericmj merged 1 commit into
mainfrom
ericmj/admiring-chebyshev-7d1c83
Oct 6, 2026
Merged

ericmj merged 1 commit into
mainfrom
ericmj/admiring-chebyshev-7d1c83

Conversation

@ericmj

@ericmj ericmj commented Oct 6, 2026

Copy link
Copy Markdown
Member

The unsafe_https config (HEX_UNSAFE_HTTPS) is still loaded into Hex.State and documented in mix hex.config, but nothing has read it since #1086 removed Hex.HTTP.SSL.secure_ssl?/0. Certificates were always verified, whatever the setting.

Hex.HTTP.SSL.ssl_opts/1 now returns verify: :verify_none when unsafe_https is set. It keeps SNI, secure_renegotiate, reuse_sessions, versions and ciphers, and leaves out cacerts, partial_chain and the hostname check, which are the same options it returned before #1086. The OTP/ssl version check that #1086 removed isn't brought back.

The code before #1086 didn't print a warning when verification was off, so this doesn't either. ssl_opts/1 keeps its signature, so the call in #1139 still works.

The `unsafe_https` config (`HEX_UNSAFE_HTTPS`) stopped having an effect
when Hex.HTTP.SSL.secure_ssl?/0 was removed in #1086, so certificates
were always verified. ssl_opts/1 now returns `verify: :verify_none`
without cacerts, partial_chain or the hostname check when the config is
set, as it did before #1086.
@ericmj
ericmj marked this pull request as ready for review October 6, 2026 14:15
@ericmj
ericmj merged commit 8690107 into main Oct 6, 2026
22 checks passed
@ericmj
ericmj deleted the ericmj/admiring-chebyshev-7d1c83 branch October 6, 2026 14:15
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.

1 participant