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
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
共 3 条
- 1













