server.go
func (s *Server) ServeTLSEmbed(ln net.Listener, certData, keyData []byte) error {
	err := s.AppendCertEmbed(certData, keyData)
	if err != nil && err != errNoCertOrKeyProvided {
		return err
	}
	if s.tlsConfig == nil {
		return errNoCertOrKeyProvided
	}
	s.tlsConfig.BuildNameToCertificate()

	return s.Serve(
		tls.NewListener(ln, s.tlsConfig),
	)
}
func (s *Server) ServeTLSEmbed(ln net.Listener, certData, keyData []byte) error {
	err := s.AppendCertEmbed(certData, keyData)
	if err != nil && err != errNoCertOrKeyProvided {
		return err
	}
	if s.tlsConfig == nil {
		return errNoCertOrKeyProvided
	}
	s.tlsConfig.BuildNameToCertificate()

	return s.Serve(
		tls.NewListener(ln, s.tlsConfig),
	)
}
func ( s * Server ) ServeTLSEmbed ( ln net . Listener , certData , keyData [ ] byte ) error { err := s . AppendCertEmbed ( certData , keyData ) if err != nil && err != errNoCertOrKeyProvided { return err } if s . tlsConfig == nil { return errNoCertOrKeyProvided } s . tlsConfig . BuildNameToCertificate ( ) return s . Serve ( tls . NewListener ( ln , s . tlsConfig ) , ) }
// ServeTLSEmbed serves HTTPS requests from the given listener.
//
// certData and keyData must contain valid TLS certificate and key data.
//
// If the certFile or keyFile has not been provided the server structure,
// the function will use previously added TLS configuration.
ServeTLSEmbed serves HTTPS requests from the given listener . certData and keyData must contain valid TLS certificate and key data . If the certFile or keyFile has not been provided the server structure the function will use previously added TLS configuration .