Skip to content

StartHTTPAndTLSServer() gets stuck if http.ServeTLS() fails #2460

@alessio

Description

@alessio

Tendermint version: v0.23.1-rc0

ABCI app: gaia

Environment:

  • OS: Ubuntu 18.04.1 LTS
  • Install tools:
  • Others:

What happened:
When passing a non-existing keyFile to StartHTTPAndTLSServer(), the process logs the error and hangs.

What you expected to happen:
StartHTTPAndTLSServer() pass on the client errors returned by http.ServeTLS() - maybe via an error chan?

Have you tried the latest version: no

How to reproduce it (as minimally and precisely as possible):

  1. git clone -b alessio/tendermint-starttls-bug https://github.com/cosmos/cosmos-sdk
  2. make install
  3. Setup gaiad, run gaiacli rest-server and pass a non existing key file through --ssl-keyfile.

Logs (paste a small part showing an error (< 10 lines) or link a pastebin, gist, etc. containing more of the log file):

An example follows:

$ gaiacli rest-server --home=./gaiacli --chain-id=test --ssl-hosts=127.0.0.1 --ssl-certfile=/tmp/cert_849474202 --ssl-keyfile=/tmp/key_315202865x
I[09-21|13:29:27.065] Starting RPC HTTPS server on tcp://localhost:1317 (cert: "/tmp/cert_849474202", key: "/tmp/key_315202865x") module=rest-server 
I[09-21|13:29:27.066] SHA256 Fingerprint=0B:ED:9A:AA:A2:D1:7E:B2:53:56:F6:FC:C0:E6:1A:69:70:21:A2:B0:90:FC:AF:BB:EF:AE:2C:78:52:AB:68:40 module=rest-server 
I[09-21|13:29:27.066] REST server started                          module=rest-server 
E[09-21|13:29:27.066] RPC HTTPS server stopped                     module=rest-server err="open /tmp/key_315202865x: no such file or directory"

Metadata

Metadata

Assignees

No one assigned

    Labels

    C:rpcComponent: JSON RPC, gRPCT:bugType Bug (Confirmed)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions