-
Notifications
You must be signed in to change notification settings - Fork 378
Open
Description
I have this cli which works fine:
lftp -e "set ssl:check-hostname no;" -p 21 -u user host.com
I am trying from golang which fails:
// FTPS server details
ftpServer := "host:21" // Replace with your FTPS server
username := "user"
password := "pwd"
var options []ftp.DialOption
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
ClientSessionCache: tls.NewLRUClientSessionCache(10),
SessionTicketsDisabled: true, // tried this and false as well.
}
options = append(options, ftp.DialWithExplicitTLS(tlsConfig))
options = append(options, ftp.DialWithTimeout(10*time.Second))
options = append(options, ftp.DialWithDebugOutput(os.Stdout))
conn, err := ftp.Dial(ftpServer, options...)
if err != nil {
panic(err)
}
defer conn.Quit()
// Authenticate with username and password
err = conn.Login(username, password)
if err != nil {
panic(err)
}
fmt.Println("Connected and authenticated to FTPS server!")
// List files in the root directory
entries, err := conn.List("/")
if err != nil {
panic(err) // err here with 522
}
fmt.Println("Files on the server:")
for _, entry := range entries {
fmt.Println(entry.Name)
}
conn.List("/")
fails with:
522 Data connection must use cached TLS session
, how should we configure tls to match the cli.
Appreciate any help.
Metadata
Metadata
Assignees
Labels
No labels