diff --git a/.golangci.yml b/.golangci.yml index c59d30d..78a206f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -36,7 +36,7 @@ linters-settings: threshold: 150 funlen: Lines: 175 - Statements: 80 + Statements: 85 goconst: min-len: 2 min-occurrences: 2 diff --git a/internal/pkg/imports/gen.go b/internal/pkg/imports/gen.go index 34b8002..1373eeb 100644 --- a/internal/pkg/imports/gen.go +++ b/internal/pkg/imports/gen.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 Cisco and/or its affiliates. +// Copyright (c) 2020-2022 Cisco and/or its affiliates. // // SPDX-License-Identifier: Apache-2.0 // @@ -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/imports-gen@v1.1.0" +//go:generate bash -c "cd $(mktemp -d) && GO111MODULE=on go install github.com/edwarnicke/imports-gen@v1.1.0" //go:generate bash -c "GOOS=linux ${GOPATH}/bin/imports-gen" diff --git a/internal/pkg/imports/imports_linux.go b/internal/pkg/imports/imports_linux.go index d73b31c..62930e9 100644 --- a/internal/pkg/imports/imports_linux.go +++ b/internal/pkg/imports/imports_linux.go @@ -3,6 +3,7 @@ package imports import ( _ "context" + _ "crypto/tls" _ "fmt" _ "github.com/antonfisher/nested-logrus-formatter" _ "github.com/edwarnicke/exechelper" diff --git a/main.go b/main.go index 6eeaabb..fd113e0 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,7 @@ package main import ( "context" + "crypto/tls" "fmt" "io/ioutil" "net" @@ -187,6 +188,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 3: creating icmp server ipam") // ******************************************************************************** @@ -227,7 +233,7 @@ func main() { grpc.Creds( grpcfd.TransportCredentials( credentials.NewTLS( - tlsconfig.MTLSServerConfig(source, source, tlsconfig.AuthorizeAny()), + tlsServerConfig, ), ), ), @@ -254,7 +260,7 @@ func main() { grpc.WithTransportCredentials( grpcfd.TransportCredentials( credentials.NewTLS( - tlsconfig.MTLSClientConfig(source, source, tlsconfig.AuthorizeAny()), + tlsClientConfig, ), ), ),