func (m *Manager) TLSConfig() *tls.Config {
	return &tls.Config{
		GetCertificate: m.GetCertificate,
		NextProtos: []string{
			"h2", "http/1.1",  
			acme.ALPNProto,  
		},
	}
}
TLSConfig creates a new TLS config suitable for net/http.Server servers,
supporting HTTP/2 and the tls-alpn-01 ACME challenge type.
package autocert
import (
	"bytes"
	"context"
	"crypto"
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/rand"
	"crypto/rsa"
	"crypto/tls"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/pem"
	"errors"
	"fmt"
	"io"
	mathrand "math/rand"
	"net"
	"net/http"
	"path"
	"strings"
	"sync"
	"time"
	"golang.org/x/crypto/acme"
)
var createCertRetryAfter = time.Minute
var pseudoRand *lockedMathRand
func init() {
	src := mathrand.NewSource(time.Now().UnixNano())
	pseudoRand = &lockedMathRand{rnd: mathrand.New(src)}
}
func AcceptTOS(tosURL string) bool { return true }
type HostPolicy func(ctx context.Context, host string) error
func HostWhitelist(hosts ...string) HostPolicy {
	whitelist := make(map[string]bool, len(hosts))
	for _, h := range hosts {
		whitelist[h] = true
	}
	return func(_ context.Context, host string) error {
		if !whitelist[host] {
			return fmt.Errorf("acme/autocert: host %q not configured in HostWhitelist", host)
		}
		return nil
	}
}
func defaultHostPolicy(context.Context, string) error {
	return nil
}
type Manager struct {
	Prompt func(tosURL string) bool
	Cache Cache
	HostPolicy HostPolicy
	RenewBefore time.Duration
	Client *acme.Client
	Email string
	ForceRSA bool
	ExtraExtensions []pkix.Extension
	clientMu sync.Mutex
	client   *acme.Client  
	stateMu sync.Mutex
	state   map[certKey]*certState
	renewalMu sync.Mutex
	renewal   map[certKey]*domainRenewal
	tokensMu sync.RWMutex
	tryHTTP01 bool
	httpTokens map[string][]byte
	certTokens map[string]*tls.Certificate
	nowFunc func() time.Time
}
type certKey struct {
	domain  string  
	isRSA   bool    
	isToken bool    
}
func (c certKey) String() string {
	if c.isToken {
		return c.domain + "+token"
	}
	if c.isRSA {
		return c.domain + "+rsa"
	}
	return c.domain
}