1
1
Fork 0
mirror of https://tildegit.org/solderpunk/molly-brown synced 2024-04-28 06:45:03 +02:00

Check for errors when parsing TLS certificates even after successful PEM decoding.

This commit is contained in:
Solderpunk 2023-03-01 19:50:45 +01:00
parent 81b4f1dcc0
commit bd07cb3507

View File

@ -76,6 +76,10 @@ func launch(sysConfig SysConfig, userConfig UserConfig, privInfo userInfo) int {
return 1
}
certx509, err := x509.ParseCertificate(certDer.Bytes)
if err != nil {
log.Println("Error parsing TLS certificate: " + err.Error())
return 1
}
err = certx509.VerifyHostname(sysConfig.Hostname)
if err != nil {
log.Println("Invalid TLS certificate: " + err.Error())