mirror of https://github.com/perkeep/perkeep.git
Merge "pk-web: enable TLS-ALPN-01 for Lets Encrypt"
This commit is contained in:
commit
78362dc1c0
|
@ -194,6 +194,8 @@ func (s *Server) Listen(addr string) error {
|
|||
}
|
||||
if s.tlsCertFile == "" && s.certManager != nil {
|
||||
config.GetCertificate = s.certManager
|
||||
// TODO(mpl): see if we can instead use
|
||||
// https://godoc.org/golang.org/x/crypto/acme/autocert#Manager.TLSConfig
|
||||
config.NextProtos = append(config.NextProtos, alpnProto)
|
||||
s.listener = tls.NewListener(s.listener, config)
|
||||
return nil
|
||||
|
|
|
@ -1036,9 +1036,7 @@ func serve(httpServer *http.Server, onHTTPError func(error)) error {
|
|||
if *adminEmail != "" {
|
||||
m.Email = *adminEmail
|
||||
}
|
||||
httpsServer.TLSConfig = &tls.Config{
|
||||
GetCertificate: m.GetCertificate,
|
||||
}
|
||||
httpsServer.TLSConfig = m.TLSConfig()
|
||||
log.Printf("Listening for HTTPS on %v", *httpsAddr)
|
||||
ln, err := net.Listen("tcp", *httpsAddr)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue