Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to create client: parse "http://127.0.0.1:8200": first path segment in URL cannot contain colon in Hashi-corp Vault

I am getting below error when executing the following commands from windows using Hashi-Corp vault.

failed to create client: parse "http://127.0.0.1:8200": first path segment in URL cannot contain colon

C:\Softwares\vault_1.0.1_windows_amd64>set VAULT_TOKEN="00000000-0000-0000-0000-000000000000"

C:\Softwares\vault_1.0.1_windows_amd64>set VAULT_ADDR="http://127.0.0.1:8200"

C:\Softwares\vault_1.0.1_windows_amd64>vault auth enable approle
failed to create client: parse "http://127.0.0.1:8200": first path segment in URL cannot contain colon

If I don't set the environemnt variables, then I get the below error.

C:\Softwares\vault_1.0.1_windows_amd64>vault auth enable approle
Error enabling approle auth: Post https://127.0.0.1:8200/v1/sys/auth/approle: http: server gave HTTP response to HTTPS client 
like image 852
PAA Avatar asked Dec 26 '18 09:12

PAA


3 Answers

I was able to solve this issue using below - Don't use "".

set VAULT_ADDR=http://127.0.0.1:8200
like image 196
PAA Avatar answered Nov 01 '22 23:11

PAA


Try this in windows , (in command prompt) ,

SET VAULT_TOKEN=00000000-0000-0000-0000-000000000000

SET VAULT_ADDR=http://127.0.0.1:8200

vault kv put secret/gs-vault-config example.username=hello example.password=world

like image 4
Naga Avatar answered Nov 02 '22 01:11

Naga


I wondered, why the above answers did not work for me, because I was using powershell.

PowerShell:

$env:VAULT_ADDR="http://127.0.0.1:8200"

$env:VAULT_TOKEN="00000000-0000-0000-0000-000000000000"

cmd.exe:

set VAULT_ADDR=http://127.0.0.1:8200

set VAULT_TOKEN=00000000-0000-0000-0000-000000000000
like image 3
Dinesh Dontha Avatar answered Nov 02 '22 01:11

Dinesh Dontha