I'm trying to make an https request in go against a URL which has an incomplete TLS certificate chain. Here's the relevant portion from the Qualys test tool, which shows the certificate chain is missing "Symantec Class 3 Secure Server CA - G4" :
Most browsers do cope with this, presumably because they have the Symantec cert preloaded? A simple golang example, however, will fail with the error x509: certificate signed by unknown authority
package main
import (
"log"
"net/http"
)
func main() {
_, err := http.Get("https://www.example.com/")
if err != nil {
log.Fatal(err)
} else {
log.Println("Success!")
}
}
I've notified the site in question, but is there a way I can insert the missing certificate into the certificate store go is using?
In these cases, your visitors might get an “incomplete chain” error. In almost all cases, it would be advisable to contact your hosting provider to fix the Incomplete certificate chain issue. Your hosting provider can help you obtain the necessary intermediate certificates and add them to your configuration.
The fastest way to fix this SSL/TLS handshake error-causing issue is just to reset your browser to the default settings and disable all your plugins. From there, you can configure the browser however you want, testing your connection with the site in question as you tweak things.
To resolve this, I just updated the system certificate store on the client to include the missing intermediate certificate.
The client was running on an Ubuntu based server, so this fixed the issue:
#download certificate
cd /usr/local/share/ca-certificates
curl -O https://symantec.tbs-certificats.com/SymantecSSG4.crt
#dump the fingerprint
openssl x509 -noout -fingerprint -sha256 -inform pem -in SymantecSSG4.crt
I checked the output matched the fingerprint the test tool reported I was missing:
SHA256 Fingerprint=EA:E7:2E:B4:54:BF:6C:39:77:EB:D2:89:E9:70:B2:F5:28:29:49:19:00:93:D0:D2:6F:98:D0:F0:D6:A9:CF:17
Then I updated the certificate store with this:
update-ca-certificates
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With