Check for errors when parsing TLS certificates even after successful PEM decoding.
This commit is contained in:
parent
81b4f1dcc0
commit
bd07cb3507
1 changed files with 4 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Reference in a new issue