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 GetClientCertificate to ensure client certificate is sent #498

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

ramondeklein
Copy link
Contributor

@ramondeklein ramondeklein commented Dec 30, 2024

It looks like tls.Config.Certificates will not always send the client certificate.

The Go TLS code contains the following:

func (c *Conn) getClientCertificate(cri *CertificateRequestInfo) (*Certificate, error) {
	if c.config.GetClientCertificate != nil {
		return c.config.GetClientCertificate(cri)
	}

	for _, chain := range c.config.Certificates {
		if err := cri.SupportsCertificate(&chain); err != nil {
			continue
		}
		return &chain, nil
	}

	// No acceptable certificate found. Don't send a certificate.
	return new(Certificate), nil
}

So if the certificate doesn't match the conditions in cri.SupportsCertificate, then it won't be sent.

@ramondeklein ramondeklein self-assigned this Dec 30, 2024
@ramondeklein ramondeklein requested a review from aead December 30, 2024 17:14
@aead aead merged commit 4945c09 into minio:master Dec 30, 2024
8 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.

2 participants