emersion / go-imap

📥 An IMAP library for clients and servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DialTLS with self-signed certificate

djdejawu opened this issue · comments

github.com/emersion/go-imap/v2 v2.0.0-alpha.7

c, err := imapclient.DialTLS(Hostname, options)
023/10/27 20:16:33 tls: failed to verify certificate: x509: certificate signed by unknown authority
exit status 1

How to dialTLS with &tls.Config{InsecureSkipVerify: true}?

You need to create the net.Conn manually then call NewClient.

What??? Why you don't apply the same as in v1 version?