-
Notifications
You must be signed in to change notification settings - Fork 4k
Remove all usage of cacerts from configuration schemas
#14655
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
Remove all usage of cacerts from configuration schemas
#14655
Conversation
As mentioned in discussion rabbitmq#14426, the way that `cacerts` is handled by cuttlefish schemas simply will not work if set. If `cacerts` were set to a string value containing one X509 certificate, it would eventually result in a crash because the `cacerts` ssl option must be of [this type](https://www.erlang.org/doc/apps/ssl/ssl.html#t:client_option_cert/0): ``` {cacerts, CACerts :: [public_key:der_encoded()] | [public_key:combined_cert()]} ``` Neither of those are strings, of course. This PR removes all use of `cacerts` in cuttlefish schemas. In addition, it filters out `cacerts` and `certs_keys` from being JSON-encoded by an HTTP API call to `/api/overview`. It _is_ technically possible to set `cacerts` via `advanced.config`, so, if set, it would crash this API call, as would `certs_keys`.
477cbfd to
ce86fb9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug fix that will be a breaking change for a very small percentage of our users but the upcoming 4.2.0 release is a good moment to ship it.
I'm pretty sure the percentage is 0%! 😄 |
Remove all usage of `cacerts` from configuration schemas (backport #14655)
|
@lukebakken every time I think "well, surely no one does THAT" we discover someone who does, and someone who's bet their farm on such an obscure feature 😭 |
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to rabbitmq#14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
Follow-up to #14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value. (cherry picked from commit 275f0a4)
As mentioned in discussion #14426, the way that
cacertsis handled by cuttlefish schemas simply will not work if set.If
cacertswere set to a string value containing one X509 certificate, it would eventually result in a crash because thecacertsssl option must be of this type:Neither of those are strings, of course. The certs would have to be decoded via
public_key:pem_decode/1then the resulting term matched to get the actual DER-encoded data.This PR removes all use of
cacertsin cuttlefish schemas. In addition, it filters outcacertsandcerts_keysfrom being JSON-encoded by an HTTP API call to/api/overview. It is technically possible to setcacertsviaadvanced.config, so, if set, it would crash this API call, as wouldcerts_keys.