Skip to content

Add ssl_options to rabbitmq_auth_backend_http's schema#11344

Merged
michaelklishin merged 7 commits intomainfrom
fix-10281
Jun 2, 2024
Merged

Add ssl_options to rabbitmq_auth_backend_http's schema#11344
michaelklishin merged 7 commits intomainfrom
fix-10281

Conversation

@MarcialRosales
Copy link
Copy Markdown
Contributor

Proposed Changes

Address feature request #10281

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

@MarcialRosales MarcialRosales self-assigned this May 29, 2024
@mergify mergify bot added the bazel label May 30, 2024
@MarcialRosales MarcialRosales requested a review from lukebakken May 30, 2024 13:15
@MarcialRosales MarcialRosales marked this pull request as ready for review May 30, 2024 13:15
@mergify mergify bot added the make label May 31, 2024
So that dialyzer can find the missing functions
Copy link
Copy Markdown
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

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

We should not use typical certificate and key filenames for sample files with invalid data, so

rabbitmq_auth_backend_http/test/config_schema_SUITE_data/certs/cacert.pem

with its current contents and its intended use in the test suite should instead be something like

rabbitmq_auth_backend_http/test/config_schema_SUITE_data/certs/invalid_cacert.pem

@michaelklishin michaelklishin merged commit 096015b into main Jun 2, 2024
@michaelklishin michaelklishin deleted the fix-10281 branch June 2, 2024 00:07
michaelklishin added a commit that referenced this pull request Jun 2, 2024
Add ssl_options to rabbitmq_auth_backend_http's schema (backport #11344)
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Dec 23, 2025
Follow-up to rabbitmq#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}]}]
```
mergify bot pushed a commit that referenced this pull request 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}]}]
```

(cherry picked from commit 4360e05)

# Conflicts:
#	deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl
michaelklishin pushed a commit that referenced this pull request Dec 24, 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}]}]
```

(cherry picked from commit 4360e05)
michaelklishin pushed a commit that referenced this pull request Feb 24, 2026
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}]}]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants