Files
2026-09-16 06:26:16 +02:00

18 lines
558 B
Go

// Package testutil provides local fixtures for integration tests only.
package testutil
import (
"crypto/tls"
"crypto/x509"
"net/http"
"net/http/httptest"
)
func TLSConfigs() (*tls.Config, *tls.Config) {
srv := httptest.NewTLSServer(http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}))
defer srv.Close()
roots := x509.NewCertPool()
roots.AddCert(srv.Certificate())
return &tls.Config{Certificates: srv.TLS.Certificates, MinVersion: tls.VersionTLS12}, &tls.Config{RootCAs: roots, ServerName: "127.0.0.1", MinVersion: tls.VersionTLS12}
}