Go autocert acme/autocert: missing server name
Asked Answered
S

0

13

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?

Sentimentalize answered 3/12, 2018 at 12:43 Comment(1)
Looks like your clients don't support SNI. If you want to host multiple domains on the same IP:port pair, that's nothing you can fix on the server.Chattanooga

© 2022 - 2024 — McMap. All rights reserved.