Skip to content

Commit

Permalink
Set minumum TLS version to 1.2
Browse files Browse the repository at this point in the history
Signed-off-by: Ed Warnicke <[email protected]>
  • Loading branch information
edwarnicke committed May 15, 2022
1 parent 3687416 commit d4f73cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/imports/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
package imports

//go:generate bash -c "rm -rf imports*.go"
//go:generate bash -c "cd $(mktemp -d) && GO111MODULE=on go get github.com/edwarnicke/[email protected]"
//go:generate bash -c "cd $(mktemp -d) && GO111MODULE=on go install github.com/edwarnicke/[email protected]"
//go:generate bash -c "GOOS=linux ${GOPATH}/bin/imports-gen"
1 change: 1 addition & 0 deletions internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package main

import (
"context"
"crypto/tls"
"fmt"

"github.com/google/uuid"
Expand Down Expand Up @@ -232,6 +233,11 @@ func main() {
}
log.FromContext(ctx).Infof("SVID: %q", svid.ID)

tlsClientConfig := tlsconfig.MTLSClientConfig(source, source, tlsconfig.AuthorizeAny())
tlsClientConfig.MinVersion = tls.VersionTLS12
tlsServerConfig := tlsconfig.MTLSServerConfig(source, source, tlsconfig.AuthorizeAny())
tlsServerConfig.MinVersion = tls.VersionTLS12

// ********************************************************************************
log.FromContext(ctx).Infof("executing phase 5: create vl3-nse")
// ********************************************************************************
Expand Down Expand Up @@ -262,9 +268,7 @@ func main() {
),
grpc.WithTransportCredentials(
grpcfd.TransportCredentials(
credentials.NewTLS(
tlsconfig.MTLSClientConfig(source, source, tlsconfig.AuthorizeAny()),
),
credentials.NewTLS(tlsClientConfig),
),
),
)
Expand Down Expand Up @@ -371,9 +375,7 @@ func createVl3Endpoint(ctx context.Context, config *Config, vppConn vpphelper.Co
tracing.WithTracing(),
grpc.Creds(
grpcfd.TransportCredentials(
credentials.NewTLS(
tlsconfig.MTLSServerConfig(source, source, tlsconfig.AuthorizeAny()),
),
credentials.NewTLS(tlsServerConfig),
),
),
)
Expand Down

0 comments on commit d4f73cf

Please sign in to comment.