让我们加密并进行

I currently have my letsencrypt certs set up for my domain www.example.com and example.com

When I open my server https://www.example.com works perfectly BUT https://example.com will give me

ERR_CONNECTION_REFUSED

I am doing the server the following way

if err := http.ListenAndServeTLS(
    ":443",
    "domain-crt.pem",
    "domain-key.pem",
    Route.router,
); err != nil {
    ERROR.Fatal(err)
}

This gives me no errors and with the www the website works fine. The .pem files are not encrypted and the ListenAndServeTLS doesn't return any error.

This as told in the comments was a DNS error caused by using URL REDIRECT record

I simply added an A record pointint @ to my IP and the same for www