Initial commit
This commit is contained in:
commit
ccc5b0cd98
26 changed files with 1806 additions and 0 deletions
15
checker/starttls.go
Normal file
15
checker/starttls.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue