-1

sudo vault operator unseal Unseal Key (will be hidden): Error unsealing: Put "https://127.0.0.1:8200/v1/sys/unseal": http: server gave HTTP response to HTTPS client

user3627034
  • 1,175
  • 8
  • 13

2 Answers2

0

The issue was resolved by removing "sudo" usage

user3627034
  • 1,175
  • 8
  • 13
0

The fix for me is to export the VAULT_ADDR, this should be exported in your shell profile (client side)

export VAULT_ADDR=http://127.0.0.1:8200

bash

Try this script to check connection: called test_sample.sh

VAULT_RETRIES=5
echo "Vault is starting..."
until vault status > /dev/null 2>&1 || [ "$VAULT_RETRIES" -eq 0 ]; do
        echo "Waiting for vault to start...: $((VAULT_RETRIES--))"
        sleep 1
done
echo "Authenticating to vault..."
vault login token=vault-plaintext-root-token
echo "Initializing vault..."
vault secrets enable -version=2 -path=my.secrets kv
echo "Adding entries..."
vault kv put my.secrets/dev username=hpc
vault kv put my.secrets/dev password=zwHM7AxNqO2A
echo "Complete..."

Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.