Why am I getting a TLS overshot error?

I am trying to use go-xmpp to connect to DuckDuckGo XMPP Services .

Below is my test case:

 package main import ( "crypto/tls" "log" "github.com/mattn/go-xmpp" ) const ( svr = "dukgo.com" usr = "testtesttest" pwd = "test123" ) func main() { xmpp.DefaultConfig = tls.Config{ ServerName: svr, InsecureSkipVerify: false, } options := xmpp.Options{ Host: svr, User: usr, Password: pwd, } _, err := options.NewClient() if err != nil { log.Fatal(err) } } 

The log.Fatal block is log.Fatal and returns the following error message:

 2016/08/24 16:32:27 tls: oversized record received with length 28012 exit status 1 

The error when starting the error indicates me an identical error in Docker, so this is not entirely useful. What does this error mean? What can I do to fix this?

+7
source share
2 answers

Like the go-xmpp package example that you use, it expects a port for tls as well.

Thus, without it, it will try to connect to the HTTP endpoint and give you this error. You will see such errors when the endpoint only supports HTTP or HTTPS with an unknown CA certificate.

Please note that the package you are using also supports No TLS double-checking DuckGo xmpp requirements and changing your code to match them.

Other posts like this

Example

https://github.com/mattn/go-xmpp/blob/master/_example/example.go

 // Server has the port var server = flag.String("server", "talk.google.com:443", "server") var username = flag.String("username", "", "username") var password = flag.String("password", "", "password") var status = flag.String("status", "xa", "status") var statusMessage = flag.String("status-msg", "I for one welcome our new codebot overlords.", "status message") var notls = flag.Bool("notls", false, "No TLS") var debug = flag.Bool("debug", false, "debug output") var session = flag.Bool("session", false, "use server session") // Omitted code var talk *xmpp.Client var err error options := xmpp.Options{Host: *server, User: *username, Password: *password, NoTLS: *notls, Debug: *debug, Session: *session, Status: *status, StatusMessage: *statusMessage, } talk, err = options.NewClient() 
+5
source

If you are using a proxy server to display images, look at the proxy configuration. In particular, make sure that the https proxy URL does not contain the string "https", for example:

 Environment="HTTPS_PROXY=https://proxy.url:8080/" => Environment="HTTPS_PROXY=http://proxy.url:8080/" 

See also here for a more complete explanation.

0
source

All Articles