mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 18:51:39 +00:00
config: make possible to set absolute paths for TLS cert and key (#3765)
This commit is contained in:
committed by
Anton Kaliaev
parent
d4cf204087
commit
d9481e3648
@ -36,3 +36,19 @@ func TestConfigValidateBasic(t *testing.T) {
|
||||
cfg.Consensus.TimeoutPropose = -10 * time.Second
|
||||
assert.Error(t, cfg.ValidateBasic())
|
||||
}
|
||||
|
||||
func TestTLSConfiguration(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
cfg := DefaultConfig()
|
||||
cfg.SetRoot("/home/user")
|
||||
|
||||
cfg.RPC.TLSCertFile = "file.crt"
|
||||
assert.Equal("/home/user/config/file.crt", cfg.RPC.CertFile())
|
||||
cfg.RPC.TLSKeyFile = "file.key"
|
||||
assert.Equal("/home/user/config/file.key", cfg.RPC.KeyFile())
|
||||
|
||||
cfg.RPC.TLSCertFile = "/abs/path/to/file.crt"
|
||||
assert.Equal("/abs/path/to/file.crt", cfg.RPC.CertFile())
|
||||
cfg.RPC.TLSKeyFile = "/abs/path/to/file.key"
|
||||
assert.Equal("/abs/path/to/file.key", cfg.RPC.KeyFile())
|
||||
}
|
||||
|
Reference in New Issue
Block a user