Enable authentication VAULT SSO with OCID Azure

Good morning!

I’m trying to integrate my VAULT vault with my AD in AZURE to effect Single Sign ON for my users when they log into the vault. However, when making the configurations on the side of the vault, I get the following error:

Error writing data to auth/oidc/config: Put “”: http: server gave HTTP response to HTTPS client

I get this error when trying to write the oidc configuration:

vault write auth/oidc/config

Below is my .hcl configuration:

store “file” {

HTTP listener

listener “tcp” {
tls_disable = 1

disable_mlock = true
api_addr = “https://IP-server:8200

I ask for your help because I’ve tried several options and I keep getting errors.

Thank you very much!

This seems pretty clear to me

TLS is disabled

Your vault CLI is set to talk to (possibly as an implicit default) but your Vault is set up for http, not https. You need to set the VAULT_ADDR environment correctly, so the vault CLI knows what URL to talk to.

I made some changes to my .hcl settings. I followed the following steps

1 - I registered the environment variable with the ip of my vault: export VAULT_ADDR=https://ip-server:8200

2 - I registered the environment variables with the root token: export VAULT_TOKEN=hvs.LXIWRMvQJmx4rFNFpzscZ3G3

My vault.hcl looks like this:

Full configuration options can be found at Server Configuration | Vault | HashiCorp Developer

ui = true

#mlock = true
disable_mlock = true

store “file” {

HTTPS listener

listener “tcp” {
tls_cert_file = “/opt/vault/tls/tls.crt”
tls_key_file = “/opt/vault/tls/tls.key”

api_addr = “https://ip-server:8200

But when trying to issue the command “vault write auth/oidc/config” with the OICD connection data, I get the following error:

Error writing data to auth/oidc/config: Put “https://ip-server:8200/v1/auth/oidc/config”: tls: failed to verify certificate: x509: cannot validate certificate for ip-server because it doesn’t 't contain any IP SANs

If you want to use https, you need to make a certificate that is actually valid for the IP or hostname you will be using in the URL.

If you don’t want to procure such a certificate, turn off TLS and use plain http.