Skip to content

Commit 426d594

Browse files
committed
fix(ftps): add host parsing for TLS configuration in login function
1 parent 1880b5a commit 426d594

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎drivers/ftps/util.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ftps
33
import (
44
"crypto/tls"
55
"io"
6+
"net"
67
"os"
78
"sync"
89
"sync/atomic"
@@ -19,7 +20,13 @@ func (d *FTPS) login() error {
1920
}
2021
}
2122

23+
host, _, err := net.SplitHostPort(d.Address)
24+
if err != nil {
25+
host = d.Address
26+
}
27+
2228
tlsConfig := &tls.Config{
29+
ServerName: host,
2330
InsecureSkipVerify: d.TLSInsecureSkipVerify,
2431
}
2532

0 commit comments

Comments
 (0)