Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go autocert acme/autocert: missing server name

I use library autocert in my application for generating an SSL certificate. The problem is 30% of users have a problem with my application. My current code is:

fmt.Println("Starting server on " + this.Params.Bind)
if this.Params.SSL {
    fmt.Println("SSL Enabled")
    m := autocert.Manager{
        Prompt:     autocert.AcceptTOS,
        HostPolicy: autocert.HostWhitelist(this.Params.HostsWhitelist...),
        Cache:      autocert.DirCache(this.Params.CertCache),
    }

    log.Fatal(autotls.RunWithManager(r, &m))
} else {
    r.Run(this.Params.Bind)
}

The errors are:

2018/12/03 12:37:33 http: TLS handshake error from 68.71.48.249:55885: acme/autocert: missing server name
2018/12/03 12:37:33 http: TLS handshake error from 209.213.121.223:38284: acme/autocert: missing server name
2018/12/03 12:37:33 http: TLS handshake error from 209.213.121.223:38283: acme/autocert: missing server name
2018/12/03 12:37:33 http: TLS handshake error from 68.71.48.249:55887: acme/autocert: missing server name
2018/12/03 12:37:33 http: TLS handshake error from 68.71.48.249:55888: acme/autocert: missing server name
2018/12/03 12:37:33 http: TLS handshake error from 209.237.150.145:56842: acme/autocert: missing server name

How can I fix the error with the missing server name?

like image 782
Lorenzo Boniot Avatar asked Jan 30 '26 12:01

Lorenzo Boniot


1 Answers

Basically it means people are trying to connect to your server using the IP and not a domain name, mostly bots.

There's nothing you can do about it.

like image 126
OneOfOne Avatar answered Feb 02 '26 03:02

OneOfOne