Skip to content
Snippets Groups Projects
Commit 39edea83 authored by Pea Nut's avatar Pea Nut Committed by jkito
Browse files

Improve error handlig and logging when writing CA file to disk

parent 0f43c044
No related branches found
No related tags found
1 merge request!198v5 implementation with a single Bitmask struct
......@@ -109,6 +109,15 @@ func Init() (*Bitmask, error) {
provider: "",
}
err = ioutil.WriteFile(b.getTempCaCertPath(), config.CaCert, 0600)
if err != nil {
return nil, err
}
log.Debug().
Str("caCertPath", b.getTempCaCertPath()).
Msg("Sucessfully wrote OpenVPN CA certificate (hardcoded in the binary, not coming from API)")
// FIXME multiprovider: need to pass provider name early on
// XXX we want to block on these, but they can timeout if we're blocked.
b.checkForMOTD()
......@@ -128,7 +137,6 @@ func Init() (*Bitmask, error) {
}
*/
err = ioutil.WriteFile(b.getTempCaCertPath(), config.CaCert, 0600)
go b.fetchGateways()
go b.openvpnManagement()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment