Golang to the rescue - Saving DevOps from TLS turmoilimplementation of HTTP net/http (https://golang.org/pkg/net/http/) has a function called ListenAndServeTLS ListenAndServeTLS provides the desired certi�cate checking functionality "If the certi�cate is signed com/ashleymcnamara/gophers) Fail Spectacularly I ❤ DevOps I embrace failure log.Fatal(srv.ListenAndServeTLS("/etc/ssl-tester/tls.crt", "/etc/ssl- tester/tls.key")) De�nes path of certi�cate �les to use0 码力 | 20 页 | 6.28 MB | 1 年前3
Golang Manual By AstaXie-20120522func(ResponseWriter, *Request)) func ListenAndServe(addr string, handler Handler) error func ListenAndServeTLS(addr string, certFile string, keyFile string, handler Handler) error func MaxBytesReader(w ResponseWriter *Request) type Server func (srv *Server) ListenAndServe() error func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error func (srv *Server) Serve(l net.Listener) error type Transport Fatal("ListenAndServe: ", err) } } func ListenAndServeTLS func ListenAndServeTLS(addr string, certFile string, keyFile string, handler Handler) error ListenAndServeTLS acts identically to ListenAndServe,0 码力 | 6205 页 | 12.83 MB | 1 年前3
Go 入门指南(The way to Go)来构建一个非常简单的网页并插入 title 和 body 的值 如果你需要更多复杂的替换,使用模板包(请看章节15.7) 3)如果你需要使用安全的https连接,使用 http.ListenAndServeTLS() 代替 http.ListenAndServe() 4) http.HandleFunc("/", Hfunc) 中的 HFunc 是一个处理函数,如下: Go入门指南 -0 码力 | 380 页 | 2.97 MB | 1 年前3
The Way To Go - 2012substitutions, use the templating package (see § 15.7). 3) If you need the security of https, use http.ListenAndServeTLS() instead of http. ListenAndServe() 4) Instead of http.HandleFunc(“/”, HFunc) where HFunc0 码力 | 629 页 | 4.85 MB | 1 年前3
Go 入门指南(The way to Go)来构建一个非常简单的网页并插入 title 和 body 的值 如果你需要更多复杂的替换,使用模板包(请看章节15.7) 3)如果你需要使用安全的https连接,使用 http.ListenAndServeTLS() 代替 http.ListenAndServe() 4) http.HandleFunc("/", Hfunc) 中的 HFunc 是一个处理函数,如下: 1. func0 码力 | 466 页 | 4.44 MB | 1 年前3
共 5 条
- 1













