func NewServerConfig(tlsCertProvider TLSCertProvider, params ...ServerParam) (*tls.Config, error) {
	if tlsCertProvider == nil {
		return nil, fmt.Errorf("tlsCertProvider provided to NewServerConfig was nil")
	}
	configurers := []configurer{certificatesParam(tlsCertProvider)}
	for _, p := range params {
		configurers = append(configurers, configurer(p.configureServer))
	}
	return configureTLSConfig(configurers...)
}
NewServerConfig returns a tls.Config that is suitable to use by a server in 2-way TLS connections configured with
the provided parameters. The provided TLSCertProvider is used as the source for the private key and certificate that
the server presents to clients.
package tlsconfig
import (
	"crypto/tls"
	"fmt"
)
type ServerParam interface {
	configureServer(*tls.Config) error
}
type serverParam func(*tls.Config) error
func (p serverParam) configureServer(cfg *tls.Config) error {
	return p(cfg)
}