I have a small golang app that creates an HTML file and hosts it:
func startHttpServer() {
port := ":8089"
dirname := "html"
fs := http.FileServer(http.Dir(dirname))
mux := http.NewServeMux()
mux.Handle("/", fs)
log.Fatal(http.ListenAndServeTLS(port, "/var/snap/platform/current/syncloud.crt", "/var/snap/platform/current/syncloud.key", mux))
}
… and it almost works. Connecting to https://<local-ip>:8089/file.html
works. The page is displayed as expected. (As you can see I use Syncloud’s certificate, so I have to confirm that I trust the page because the certificate is only valid for <name>.syncloud.it
, but then it works.)
However, connecting from outside via my actual URL does not work: https://<name>.syncloud.it:8089/file.html
shows this error message in Firefox:
Secure Connection Failed
An error occurred during a connection to [name].syncloud.it:8089. PR_END_OF_FILE_ERROR
Error code: PR_END_OF_FILE_ERROR
And this is what Chrome displays:
This site can’t be reached
The connection was reset.
Try:
- Checking the connection
- Checking the proxy and the firewall
ERR_CONNECTION_RESET
curl
reports an SSL error:
curl -v https://[name].syncloud.it:8089/file.html
* Host [name].syncloud.it:8089 was resolved.
* IPv6: (none)
* IPv4: [public-ip]
* Trying [public-ip]:8089...
* Connected to [name].syncloud.it ([public-ip]) port 8089
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: none
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to [name].syncloud.it:8089
* Closing connection
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to [name].syncloud.it:8089
Any idea what’s wrong?
Cheers!