Fatal If No TLS Found in RPC Service (#7614)

* fatal if no tls found rpc

* tests

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Raul Jordan
2020-10-22 18:58:53 -05:00
committed by GitHub
parent e54ac48f9d
commit ca081e8639
3 changed files with 2 additions and 6 deletions

View File

@@ -208,8 +208,7 @@ func (s *Service) Start() {
if s.withCert != "" && s.withKey != "" {
creds, err := credentials.NewServerTLSFromFile(s.withCert, s.withKey)
if err != nil {
log.Errorf("Could not load TLS keys: %s", err)
s.credentialError = err
log.WithError(err).Fatal("Could not load TLS keys")
}
opts = append(opts, grpc.Creds(creds))
} else {

View File

@@ -28,8 +28,6 @@ func TestLifecycle_OK(t *testing.T) {
}
rpcService := NewService(context.Background(), &Config{
Port: "7348",
CertFlag: "alice.crt",
KeyFlag: "alice.key",
SyncService: &mockSync.Sync{IsSyncing: false},
BlockReceiver: chainService,
AttestationReceiver: chainService,

View File

@@ -123,8 +123,7 @@ func (s *Server) Start() {
if s.withCert != "" && s.withKey != "" {
creds, err := credentials.NewServerTLSFromFile(s.withCert, s.withKey)
if err != nil {
log.Errorf("Could not load TLS keys: %s", err)
s.credentialError = err
log.WithError(err).Fatal("Could not load TLS keys")
}
opts = append(opts, grpc.Creds(creds))
log.WithFields(logrus.Fields{