// Copyright 2017 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.packageautocert_testimport("fmt""log""net/http""golang.org/x/crypto/acme/autocert")funcExampleNewListener(){mux:=http.NewServeMux()mux.HandleFunc("/",func(whttp.ResponseWriter,r*http.Request){fmt.Fprintf(w,"Hello, TLS user! Your config: %+v",r.TLS)})log.Fatal(http.Serve(autocert.NewListener("example.com"),mux))}funcExampleManager(){m:=&autocert.Manager{Cache:autocert.DirCache("secret-dir"),Prompt:autocert.AcceptTOS,HostPolicy:autocert.HostWhitelist("example.org","www.example.org"),}s:=&http.Server{Addr:":https",TLSConfig:m.TLSConfig(),}s.ListenAndServeTLS("","")}