Skip to content

Commit 1940e53

Browse files
committed
revert changes on main.go (unwanted dev mode)
1 parent 695e475 commit 1940e53

File tree

1 file changed

+10
-2
lines changed
  • contrib/envoyproxy/go-control-plane/cmd/serviceextensions

1 file changed

+10
-2
lines changed

contrib/envoyproxy/go-control-plane/cmd/serviceextensions/main.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package main
77

88
import (
99
"context"
10+
"crypto/tls"
1011
"errors"
1112
"fmt"
1213
"net"
@@ -17,10 +18,12 @@ import (
1718
"syscall"
1819
"time"
1920

21+
"golang.org/x/sync/errgroup"
22+
"google.golang.org/grpc/credentials"
23+
2024
gocontrolplane "github.com/DataDog/dd-trace-go/contrib/envoyproxy/go-control-plane/v2"
2125
"github.com/DataDog/dd-trace-go/v2/ddtrace/tracer"
2226
"github.com/DataDog/dd-trace-go/v2/instrumentation"
23-
"golang.org/x/sync/errgroup"
2427

2528
extproc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3"
2629
"google.golang.org/grpc"
@@ -173,7 +176,12 @@ func startGPRCSsl(ctx context.Context, service extproc.ExternalProcessorServer,
173176
return fmt.Errorf("gRPC server: %s", err.Error())
174177
}
175178

176-
grpcServer := grpc.NewServer()
179+
cert, err := tls.LoadX509KeyPair("localhost.crt", "localhost.key")
180+
if err != nil {
181+
return fmt.Errorf("failed to load key pair: %s", err.Error())
182+
}
183+
184+
grpcServer := grpc.NewServer(grpc.Creds(credentials.NewServerTLSFromCert(&cert)))
177185
appsecEnvoyExternalProcessorServer := gocontrolplane.AppsecEnvoyExternalProcessorServer(
178186
service,
179187
gocontrolplane.AppsecEnvoyConfig{

0 commit comments

Comments
 (0)