mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdmain: pass logger to "transport.SelfCert"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
a173e761bb
commit
d5bcf66b6b
@ -318,7 +318,7 @@ func startProxy(cfg *config) error {
|
|||||||
}
|
}
|
||||||
listenerTLS := cfg.ec.ClientTLSInfo
|
listenerTLS := cfg.ec.ClientTLSInfo
|
||||||
if cfg.ec.ClientAutoTLS && cTLS {
|
if cfg.ec.ClientAutoTLS && cTLS {
|
||||||
listenerTLS, err = transport.SelfCert(filepath.Join(cfg.ec.Dir, "clientCerts"), cHosts)
|
listenerTLS, err = transport.SelfCert(cfg.ec.Logger, filepath.Join(cfg.ec.Dir, "clientCerts"), cHosts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
plog.Fatalf("proxy: could not initialize self-signed client certs (%v)", err)
|
plog.Fatalf("proxy: could not initialize self-signed client certs (%v)", err)
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ import (
|
|||||||
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||||
"github.com/soheilhy/cmux"
|
"github.com/soheilhy/cmux"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"go.uber.org/zap"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
)
|
)
|
||||||
@ -162,7 +163,11 @@ func startGRPCProxy(cmd *cobra.Command, args []string) {
|
|||||||
if tlsinfo == nil && grpcProxyListenAutoTLS {
|
if tlsinfo == nil && grpcProxyListenAutoTLS {
|
||||||
host := []string{"https://" + grpcProxyListenAddr}
|
host := []string{"https://" + grpcProxyListenAddr}
|
||||||
dir := filepath.Join(grpcProxyDataDir, "fixtures", "proxy")
|
dir := filepath.Join(grpcProxyDataDir, "fixtures", "proxy")
|
||||||
autoTLS, err := transport.SelfCert(dir, host)
|
lg, _ := zap.NewProduction()
|
||||||
|
if grpcProxyDebug {
|
||||||
|
lg = zap.NewExample()
|
||||||
|
}
|
||||||
|
autoTLS, err := transport.SelfCert(lg, dir, host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
plog.Fatal(err)
|
plog.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user