Applied env package for client cmd
This commit is contained in:
parent
384ac7083f
commit
ca3534c5f4
|
@ -20,10 +20,13 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cert, err := os.ReadFile("server.pem")
|
loadingFileName := env.ServerFullchainFileName
|
||||||
|
cert, err := os.ReadFile(loadingFileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("client: load root cert: %s", err)
|
log.Fatalf("client: load root cert: %s", err)
|
||||||
}
|
}
|
||||||
|
log.Printf("Certificate %s loaded successfully!\n", loadingFileName)
|
||||||
|
//
|
||||||
roots := x509.NewCertPool()
|
roots := x509.NewCertPool()
|
||||||
if ok := roots.AppendCertsFromPEM(cert); !ok {
|
if ok := roots.AppendCertsFromPEM(cert); !ok {
|
||||||
log.Fatalf("client: failed to parse root certificate")
|
log.Fatalf("client: failed to parse root certificate")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user