Skip to content

Commit 6faaf48

Browse files
committed
Refactor cert loading into certs package
1 parent 640bc57 commit 6faaf48

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

common/tls.go certs/load.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package common
1+
package certs
22

33
import (
44
"crypto/tls"

client/run.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package client
22

33
import (
44
"context"
5-
"github.com/itzg/grpc-authenticated-greeter/common"
5+
"github.com/itzg/grpc-authenticated-greeter/certs"
66
"github.com/itzg/grpc-authenticated-greeter/protocol"
77
"github.com/sirupsen/logrus"
88
"google.golang.org/grpc"
@@ -22,7 +22,7 @@ func Run(caCert string, privateKey string, privateCert string, serverAddress str
2222
serverName = host
2323
}
2424

25-
tlsConfig, err := common.LoadClientTlsConfig(caCert, privateKey, privateCert, serverName)
25+
tlsConfig, err := certs.LoadClientTlsConfig(caCert, privateKey, privateCert, serverName)
2626
if err != nil {
2727
logrus.WithError(err).Fatal("loading client tls config")
2828
}

server/run.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package server
22

33
import (
44
"crypto/tls"
5-
"github.com/itzg/grpc-authenticated-greeter/common"
5+
"github.com/itzg/grpc-authenticated-greeter/certs"
66
"github.com/itzg/grpc-authenticated-greeter/protocol"
77
"github.com/sirupsen/logrus"
88
"google.golang.org/grpc"
@@ -21,7 +21,7 @@ func Run(caCert string, privateKey string, privateCert string, binding string) {
2121
logrus.WithError(err).Fatal("loading key pair")
2222
}
2323

24-
clientCertPool, err := common.LoadCertPool(caCert)
24+
clientCertPool, err := certs.LoadCertPool(caCert)
2525
if err != nil {
2626
logrus.WithError(err).Fatal("loading CA cert")
2727
}

0 commit comments

Comments
 (0)