Initial commit

This commit is contained in:
nemunaire 2026-04-21 21:50:49 +07:00
commit ccc5b0cd98
26 changed files with 1806 additions and 0 deletions

15
checker/starttls.go Normal file
View file

@ -0,0 +1,15 @@
package checker
import "net"
// starttlsUpgrader performs the plaintext portion of a STARTTLS upgrade on
// conn, leaving conn ready for tls.Client(conn, …).Handshake(). On success
// the returned function returns nil; on failure it returns a descriptive
// error (wrap errStartTLSNotOffered when the server advertises no STARTTLS).
type starttlsUpgrader func(conn net.Conn, sni string) error
var starttlsUpgraders = map[string]starttlsUpgrader{}
func registerStartTLS(protocol string, upgrader starttlsUpgrader) {
starttlsUpgraders[protocol] = upgrader
}