Forgot to check some errors

This commit is contained in:
Jakob Borg 2014-09-20 15:31:15 +02:00
parent 4810879b2f
commit d9b0a73787

View File

@ -68,13 +68,17 @@ func newCertificate(dir string, prefix string) {
certOut, err := os.Create(filepath.Join(dir, prefix+"cert.pem"))
l.FatalErr(err)
pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes})
certOut.Close()
err = pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes})
l.FatalErr(err)
err = certOut.Close()
l.FatalErr(err)
keyOut, err := os.OpenFile(filepath.Join(dir, prefix+"key.pem"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
l.FatalErr(err)
pem.Encode(keyOut, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)})
keyOut.Close()
err = pem.Encode(keyOut, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)})
l.FatalErr(err)
err = keyOut.Close()
l.FatalErr(err)
}
type DowngradingListener struct {