GithubHelp home page GithubHelp logo

Comments (4)

jwatson-gcu avatar jwatson-gcu commented on July 19, 2024

You need to provide a TLSConfig:

dialConfig := goftp.Config{
	User:      "User",
	Password:  "Password",
	TLSMode:   goftp.TLSExplicit,
	TLSConfig: &tls.Config{
		MinVersion: tls.VersionTLS12,
		NextProtos: []string{"http/1.1"},
		ServerName: strings.Split(addr, ":")[0],
	},
}

from goftp.

avvaripawan avatar avvaripawan commented on July 19, 2024

jwatson-gcu thank for the update . But still i am getting error .I applied above snippet

ftpconfig := goftp.Config{

	User:     "******",
	Password: "******",
	TLSMode:  goftp.TLSExplicit,
	TLSConfig: &tls.Config{
		MinVersion: tls.VersionTLS12,
		NextProtos: []string{"http/1.1"},
		ServerName: strings.Split("*****", ":")[0],      #### in place of star i have taken ip addres like 34.89.17.98:21
	},
}

fmt.Println(ftpconfig)

client, err := goftp.DialConfig(ftpconfig, "*****")    ####here also same 
if err != nil {
	fmt.Println(err)
}
defer client.Close()

error:
connected to ftp server successfully!!!
error writing command: tls: server selected unsupported protocol version 301
[]

You need to provide a TLSConfig:

dialConfig := goftp.Config{
	User:      "User",
	Password:  "Password",
	TLSMode:   goftp.TLSExplicit,
	TLSConfig: &tls.Config{
		MinVersion: tls.VersionTLS12,
		NextProtos: []string{"http/1.1"},
		ServerName: strings.Split(addr, ":")[0],
	},
}

from goftp.

jwatson-gcu avatar jwatson-gcu commented on July 19, 2024

The error indicates that the server you are connecting to does not support TLS 1.2 i.e. MinVersion: tls.VersionTLS12

Remove MinVersion from tls.Config and give it a try.

from goftp.

avvaripawan avatar avvaripawan commented on July 19, 2024

thank's for the update

from goftp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.