mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Forgot to check some errors
This commit is contained in:
parent
4810879b2f
commit
d9b0a73787
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user