Merge pull request #61 from defuse/fix-very-insecure

Make -very-insecure imply 'don't use TLS.'
This commit is contained in:
Marshall Gaucher 2019-09-18 18:37:49 -07:00 committed by GitHub
commit 6ac80494ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -152,7 +152,9 @@ func main() {
// gRPC initialization
var server *grpc.Server
if opts.tlsCertPath != "" && opts.tlsKeyPath != "" {
if opts.veryInsecure {
server = grpc.NewServer(LoggingInterceptor())
} else {
transportCreds, err := credentials.NewServerTLSFromFile(opts.tlsCertPath, opts.tlsKeyPath)
if err != nil {
log.WithFields(logrus.Fields{
@ -162,11 +164,7 @@ func main() {
}).Fatal("couldn't load TLS credentials")
}
server = grpc.NewServer(grpc.Creds(transportCreds), LoggingInterceptor())
} else {
if (opts.veryInsecure) {
server = grpc.NewServer(LoggingInterceptor())
}
}
}
// Enable reflection for debugging
if opts.logLevel >= uint64(logrus.WarnLevel) {