From c56f6c1c12b397a4fa72b73ed05e2fc22273b5d4 Mon Sep 17 00:00:00 2001 From: finlab Date: Sun, 17 Jan 2021 22:15:20 +0800 Subject: [PATCH] comment gateway-tls gateway creds --- cmd/gateway-tls/main.go | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/cmd/gateway-tls/main.go b/cmd/gateway-tls/main.go index 722247c..4edef37 100644 --- a/cmd/gateway-tls/main.go +++ b/cmd/gateway-tls/main.go @@ -54,29 +54,29 @@ func main() { } } -func gwCreds() credentials.TransportCredentials { - cert, err := tls.LoadX509KeyPair("./cert/server.pem", "./cert/server.key") - if err != nil { - log.Fatal(err) - } +// func gwCreds() credentials.TransportCredentials { +// cert, err := tls.LoadX509KeyPair("./cert/server.pem", "./cert/server.key") +// if err != nil { +// log.Fatal(err) +// } - certPool := x509.NewCertPool() - ca, err := ioutil.ReadFile("./cert/ca.pem") - if err != nil { - log.Fatal(err) - } - if ok := certPool.AppendCertsFromPEM(ca); !ok { - log.Fatal("failed to append certs") - } +// certPool := x509.NewCertPool() +// ca, err := ioutil.ReadFile("./cert/ca.pem") +// if err != nil { +// log.Fatal(err) +// } +// if ok := certPool.AppendCertsFromPEM(ca); !ok { +// log.Fatal("failed to append certs") +// } - creds := credentials.NewTLS(&tls.Config{ - Certificates: []tls.Certificate{cert}, - ClientAuth: tls.RequireAndVerifyClientCert, // NOTE: this is optional! - ClientCAs: certPool, - }) +// creds := credentials.NewTLS(&tls.Config{ +// Certificates: []tls.Certificate{cert}, +// ClientAuth: tls.RequireAndVerifyClientCert, // NOTE: this is optional! +// ClientCAs: certPool, +// }) - return creds -} +// return creds +// } func grpcServerClientCreds() grpc.DialOption { cert, err := tls.LoadX509KeyPair("./cert/client.pem", "./cert/client.key")