Skip to content
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

Use default certificate if no certificates match #126

Merged

Conversation

ramondeklein
Copy link
Contributor

The default Go TLS implementation always returns the first certificate (that's the "default" or "fallback" certificate) if none of the certificates match (source). Although that may be an issue for the client, the TLS handshake can continue. If no certificate is returned at all, the TLS handshake is aborted and the client gets a TLS failure.

MinIO always returns the default certificate if there is only one certificate (source) or when no server-name is set. If multiple certificates are added and none of them matches then nil is returned. Although the function returns an error, this error isn't visible in the console and/or mc admin trace.

This PR changes the behavior, so it always returns the default certificate when none of the certificates match (just like the default Go TLS implementation). Although this may be considered less secure (it provides the server's FQDN when hitting the server with an arbitrary server name), this information is already provided when the attacker hits the server without SNI.

Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

LGTM, but not an expert on this.

@harshavardhana harshavardhana merged commit 30d535c into minio:main Aug 12, 2024
3 checks passed
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.

6.0.1 sidecar fails readiness probe with TLS enabled.
3 participants