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

By ego008 at 2018-01-15 19:55 • 899次点击
ego008

跟进还挺快

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


acme, autocert, , http


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

Domain: "yourdomain.com"
HttpsOn: true
qoo酷儿 at 2018-01-16 16:02
1

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

ego008 at 2018-01-16 16:27
2
登录 后发表评论