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

set a GetCertificate callback in the tls.Config #2404

Merged
merged 1 commit into from Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions caddytls/config.go
Expand Up @@ -269,6 +269,13 @@ func MakeTLSConfig(configs []*Config) (*tls.Config, error) {
}

return &tls.Config{
// A tls.Config must have Certificates or GetCertificate
// set, in order to be accepted by tls.Listen and quic.Listen.
// TODO: remove this once the standard library allows a tls.Config with
// only GetConfigForClient set.
GetCertificate: func(*tls.ClientHelloInfo) (*tls.Certificate, error) {
mholt marked this conversation as resolved.
Show resolved Hide resolved
return nil, fmt.Errorf("all certificates configured via GetConfigForClient")
},
GetConfigForClient: configMap.GetConfigForClient,
}, nil
}
Expand Down