Rename and export some types, other minor changes

This commit is contained in:
Matthew Holt
2019-05-14 14:14:05 -06:00
parent 8ae0d6a509
commit f9d93ead4e
7 changed files with 151 additions and 106 deletions

View File

@ -85,6 +85,9 @@ func (cp *ConnectionPolicy) buildStandardTLSConfig(handle caddy2.Handle) error {
NextProtos: cp.ALPN,
PreferServerCipherSuites: true,
GetCertificate: func(hello *tls.ClientHelloInfo) (*tls.Certificate, error) {
// TODO: Must fix https://github.com/mholt/caddy/issues/2588
// (allow customizing the selection of a very specific certificate
// based on the ClientHelloInfo)
cfgTpl, err := tlsApp.getConfigForName(hello.ServerName)
if err != nil {
return nil, fmt.Errorf("getting config for name %s: %v", hello.ServerName, err)