Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: DialWithDialer timed out #329

Closed
huuthinh47 opened this issue May 17, 2023 · 1 comment
Closed

tls: DialWithDialer timed out #329

huuthinh47 opened this issue May 17, 2023 · 1 comment
Labels
defect The code does not work as intended

Comments

@huuthinh47
Copy link

huuthinh47 commented May 17, 2023

DialWithDialer timed out
I can login and create new folder on my server but i can't upload files.

	client, err := ftp.Dial("123.199.198.70:21",
		ftp.DialWithTimeout(60*time.Second),
		ftp.DialWithExplicitTLS(&tls.Config{
			InsecureSkipVerify: true,
			ServerName:         "123.199.198.70:21"}),
		ftp.DialWithDebugOutput(os.Stdout),
	)

	if err != nil {
		log.Fatal(err)
	}

	err = client.Login("root", "123Abc")
	if err != nil {
		log.Fatal(err)
	}

	// Do something with the FTP conn
	defer client.Quit()
	remoteDirPath := filepath.Dir(remotePath)
	file, err := os.Open(localPath)
	if err != nil {
		return err
	}
	defer file.Close()

	// Change to the target directory on the FTP server
	err = client.ChangeDir(remoteDirPath)
	if err != nil {
		log.Fatal(err)
	}

	// Upload the local file to the FTP server
	err = client.Stor(remotePath, file)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("File uploaded successfully.")

	return nil

Message Error

2023-05-17 21:35:04 220 (vsFTPd 3.0.3)
2023-05-17 21:35:04 AUTH TLS
2023-05-17 21:35:04 234 Proceed with negotiation.
2023-05-17 21:35:04 USER root
2023-05-17 21:35:04 331 Please specify the password.
2023-05-17 21:35:04 PASS abc
2023-05-17 21:35:04 230 Login successful.
2023-05-17 21:35:04 FEAT
2023-05-17 21:35:04 211-Features:
2023-05-17 21:35:04  AUTH TLS
2023-05-17 21:35:04  EPRT
2023-05-17 21:35:04  EPSV
2023-05-17 21:35:04  MDTM
2023-05-17 21:35:04  PASV
2023-05-17 21:35:04  PBSZ
2023-05-17 21:35:04  PROT
2023-05-17 21:35:04  REST STREAM
2023-05-17 21:35:04  SIZE
2023-05-17 21:35:04  TVFS
2023-05-17 21:35:04 211 End
2023-05-17 21:35:04 TYPE I
2023-05-17 21:35:04 200 Switching to Binary mode.
2023-05-17 21:35:04 PBSZ 0
2023-05-17 21:35:04 200 PBSZ set to 0.
2023-05-17 21:35:04 PROT P
2023-05-17 21:35:04 200 PROT now Private.
2023-05-17 21:35:04 CWD /home/html/media.abc.com/tmp/00
2023-05-17 21:35:04 250 Directory successfully changed.
2023-05-17 21:35:04 EPSV
2023-05-17 21:35:04 229 Entering Extended Passive Mode (|||43392|)
2023-05-17 21:36:04 2023/05/17 14:36:04 tls: DialWithDialer timed out
@huuthinh47 huuthinh47 added the defect The code does not work as intended label May 17, 2023
@jlaffaye
Copy link
Owner

Should be fixed fixed by #283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect The code does not work as intended
Projects
None yet
Development

No branches or pull requests

2 participants