ego008
ego008
4665 2 0

acme/autocert 库更新,支持 http-01

跟进还挺快

func ExampleManager() {
m := &autocert.Manager{
Cache:      autocert.DirCache("secret-dir"),
Prompt:     autocert.AcceptTOS,
HostPolicy: autocert.HostWhitelist("example.org"),
}
go http.ListenAndServe(":http", m.HTTPHandler(nil)) // 添加这一行
s := &http.Server{
Addr:      ":https",
TLSConfig: &tls.Config{GetCertificate: m.GetCertificate},
}
s.ListenAndServeTLS("", "")
}

又可以一键开启https

0

See Also

Nearby


Discussion (2)

qoo酷儿
qoo酷儿 2018-01-16 08:02

什么意思? 是不是说又原来的那样简单就可以了?

Domain: "yourdomain.com"
HttpsOn: true
0
ego008
ego008 2018-01-16 08:27

@qoo酷儿 是的,程序晚点再更新

0
Login Topics