Skip to content

Commit

Permalink
Fatal If No TLS Found in RPC Service (#7614)
Browse files Browse the repository at this point in the history
* fatal if no tls found rpc

* tests

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
rauljordan and prylabs-bulldozer[bot] committed Oct 22, 2020
1 parent e54ac48 commit ca081e8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions beacon-chain/rpc/service.go
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions beacon-chain/rpc/service_test.go
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions validator/rpc/server.go
Expand Up @@ -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{
Expand Down

0 comments on commit ca081e8

Please sign in to comment.