Skip to content

Correctly add customize_hostname_check to ssl options (backport #15184)#15185

Merged
michaelklishin merged 2 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15184
Dec 24, 2025
Merged

Correctly add customize_hostname_check to ssl options (backport #15184)#15185
michaelklishin merged 2 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15184

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Dec 23, 2025

Follow-up to #11344

Prior to this fix, the customize_hostname_check option was incorrectly added to the general options passed to httpc:request, which results in the following error when the request is made:

[debug] <0.1.0> Enabling wildcard-aware hostname verification for HTTP client connections
[notice] <0.1.0> Invalid option {customize_hostname_check,
[notice] <0.1.0>                    [{match_fun,#Fun<public_key.6.112534691>}]} ignored
[notice] <0.1.0>

With this fix, you can see that customize_hostname_check is added to the ssl section of the options:

1> redbug:start("rabbit_auth_backend_http:ssl_options->return").
...
...
...
% rabbit_auth_backend_http:ssl_options/0 -> [{ssl,
                                              [{customize_hostname_check,
                                                [{match_fun,
                                                  #Fun<public_key.6.112534691>}]},
                                               {versions,
                                                ['tlsv1.3','tlsv1.2',
                                                 'tlsv1.1',tlsv1]},
                                               {hibernate_after,6000},
                                               {keyfile,
                                                "key.pem"},
                                               {depth,10},
                                               {crl_check,false},
                                               {certfile,
                                                "certificate.pem"},
                                               {cacertfile,
                                                "ca_certificate.pem"},
                                               {fail_if_no_peer_cert,false},
                                               {verify,verify_peer}]}]
```<hr>This is an automatic backport of pull request #15184 done by [Mergify](https://mergify.com).

Follow-up to #11344

Prior to this fix, the `customize_hostname_check` option was incorrectly
added to the general options passed to `httpc:request`, which results in
the following error when the request is made:

```
[debug] <0.1.0> Enabling wildcard-aware hostname verification for HTTP client connections
[notice] <0.1.0> Invalid option {customize_hostname_check,
[notice] <0.1.0>                    [{match_fun,#Fun<public_key.6.112534691>}]} ignored
[notice] <0.1.0>
```

With this fix, you can see that `customize_hostname_check` is added to
the `ssl` section of the options:

```
1> redbug:start("rabbit_auth_backend_http:ssl_options->return").
...
...
...
% rabbit_auth_backend_http:ssl_options/0 -> [{ssl,
                                              [{customize_hostname_check,
                                                [{match_fun,
                                                  #Fun<public_key.6.112534691>}]},
                                               {versions,
                                                ['tlsv1.3','tlsv1.2',
                                                 'tlsv1.1',tlsv1]},
                                               {hibernate_after,6000},
                                               {keyfile,
                                                "key.pem"},
                                               {depth,10},
                                               {crl_check,false},
                                               {certfile,
                                                "certificate.pem"},
                                               {cacertfile,
                                                "ca_certificate.pem"},
                                               {fail_if_no_peer_cert,false},
                                               {verify,verify_peer}]}]
```

(cherry picked from commit 4360e05)

# Conflicts:
#	deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl
@mergify
Copy link
Copy Markdown
Author

mergify bot commented Dec 23, 2025

Cherry-pick of 4360e05 has failed:

On branch mergify/bp/v4.2.x/pr-15184
Your branch is up to date with 'origin/v4.2.x'.

You are currently cherry-picking commit 4360e05df.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Follow-up to #11344

Prior to this fix, the `customize_hostname_check` option was incorrectly
added to the general options passed to `httpc:request`, which results in
the following error when the request is made:

```
[debug] <0.1.0> Enabling wildcard-aware hostname verification for HTTP client connections
[notice] <0.1.0> Invalid option {customize_hostname_check,
[notice] <0.1.0>                    [{match_fun,#Fun<public_key.6.112534691>}]} ignored
[notice] <0.1.0>
```

With this fix, you can see that `customize_hostname_check` is added to
the `ssl` section of the options:

```
1> redbug:start("rabbit_auth_backend_http:ssl_options->return").
...
...
...
% rabbit_auth_backend_http:ssl_options/0 -> [{ssl,
                                              [{customize_hostname_check,
                                                [{match_fun,
                                                  #Fun<public_key.6.112534691>}]},
                                               {versions,
                                                ['tlsv1.3','tlsv1.2',
                                                 'tlsv1.1',tlsv1]},
                                               {hibernate_after,6000},
                                               {keyfile,
                                                "key.pem"},
                                               {depth,10},
                                               {crl_check,false},
                                               {certfile,
                                                "certificate.pem"},
                                               {cacertfile,
                                                "ca_certificate.pem"},
                                               {fail_if_no_peer_cert,false},
                                               {verify,verify_peer}]}]
```

(cherry picked from commit 4360e05)
@michaelklishin michaelklishin added this to the 4.2.3 milestone Dec 24, 2025
@michaelklishin michaelklishin merged commit b1ca0b5 into v4.2.x Dec 24, 2025
574 of 575 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-15184 branch December 24, 2025 05:56
michaelklishin added a commit that referenced this pull request Dec 24, 2025
Correctly add `customize_hostname_check` to `ssl` options (backport #15184)

(cherry picked from commit b1ca0b5)
@michaelklishin
Copy link
Copy Markdown
Collaborator

michaelklishin commented Dec 24, 2025

Backported manually to v4.1.x for 4.1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants