net/tlsdial: add memory-optimized TLS cert verification path for iOS

Behind a build tag for now.
This commit is contained in:
Brad Fitzpatrick
2020-04-25 13:55:51 -07:00
parent b6fa5a69be
commit 6fcbd4c4d4
3 changed files with 70 additions and 1 deletions

View File

@ -8,6 +8,8 @@ package tlsdial
import "crypto/tls"
var platformModifyConf func(*tls.Config)
// Config returns a tls.Config for dialing the given host.
// If base is non-nil, it's cloned as the base config before
// being configured and returned.
@ -20,5 +22,9 @@ func Config(host string, base *tls.Config) *tls.Config {
}
conf.ServerName = host
if platformModifyConf != nil {
platformModifyConf(conf)
}
return conf
}