mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-09 23:42:55 +01:00
fix: tls config unused with dialer
This ensures the configured tls.Config is used with the tls.Dialer.
This commit is contained in:
parent
6a7d49f1b6
commit
b8646489ae
1 changed files with 3 additions and 1 deletions
|
@ -431,9 +431,11 @@ func (c *Client) DialWithContext(pc context.Context) error {
|
||||||
defer cfn()
|
defer cfn()
|
||||||
|
|
||||||
nd := net.Dialer{}
|
nd := net.Dialer{}
|
||||||
td := tls.Dialer{}
|
|
||||||
var err error
|
var err error
|
||||||
if c.ssl {
|
if c.ssl {
|
||||||
|
td := tls.Dialer{NetDialer: &nd, Config: c.tlsconfig}
|
||||||
|
|
||||||
c.enc = true
|
c.enc = true
|
||||||
c.co, err = td.DialContext(ctx, "tcp", c.ServerAddr())
|
c.co, err = td.DialContext(ctx, "tcp", c.ServerAddr())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue