I've tried this but srv.TLSConfig is always non-nil. package main
import ( "log" "net/http" "time" ) func main() { srv := &http.Server{Addr: ":8080"} go srv.ListenAndServe() time.Sleep(25 * time.Millisecond) if srv.TLSConfig == nil { log.Println("Started HTTP Server on ", srv.Addr) } else { log.Println("Started HTTPS Server on ", srv.Addr) } } $ go run main.go 2017/05/24 22:50:15 Started HTTPS Server on :8080 Thx Frank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.