Vault User Interface working but there are command line errors

I’ve recently setup Vault Server with Secure HTTP - using a self-signed certificate (using ip address of my enterprise network). I’ve unsealed Vault server, enabled KV secrets engine, added Policy, users - all these via Vault user interface.

My hcl configuration file:

listener “tcp” {
address = “0.0.0.0:8200
tls_disable = 0
tls_cert_file = “/etc/ssl/certs/certificate.pem”
tls_key_file = “/etc/ssl/certs/key.unencrypted.pem”
}

storage “file” {
path = “/users/mydirectory/vault/data”
}

api_addr = “https://ip address:8200”
ui = true

Then I exported VAULT_PATH and VAULT_TOKEN in my terminal command line (in enterprise network).

I tried to write the user password from command line (terminal):

vault write auth/userpass/users/john_doe password=“john123”

And I get the following error:

Error writing data to auth/userpass/users/john_doe: Put https://ip address:8200/v1/auth/userpass/users/john_doe: dial tcp ip address:8200: i/o timeout

Then I try to put the same command from the UI CLI. And it worked!

I got more curious and tried the simplest of Vault command from my terminal.

vault status

Error checking seal status: Get https://ip address:8200/v1/sys/seal-status: dial tcp :8200: i/o timeout

I’m at a loss why I’m getting this error on the command line. Is this something to do with self-signed certificates or is it something else?

Thanking you all in advance.

@ranaaich : I am also facing the same issue for a long time. Did you get the fix?