Add support for self-signed certificates

This commit is contained in:
Mickael Remond
2019-07-15 12:18:35 +02:00
committed by Mickaël Rémond
parent 79803a8af9
commit 9577036327
7 changed files with 56 additions and 18 deletions
+3 -2
View File
@@ -86,8 +86,9 @@ func (c *ServerCheck) Check() error {
return fmt.Errorf("expecting starttls proceed: %s", err)
}
stanza.DefaultTlsConfig.ServerName = c.domain
tlsConn := tls.Client(tcpconn, &stanza.DefaultTlsConfig)
var tlsConfig tls.Config
tlsConfig.ServerName = c.domain
tlsConn := tls.Client(tcpconn, &tlsConfig)
// We convert existing connection to TLS
if err = tlsConn.Handshake(); err != nil {
return err