# Vault initial token?

**URL:** <https://discuss.hashicorp.com/t/vault-initial-token/45373>\
**Category:** Vault\
**Created:** [October 9, 2022, 10:50pm UTC](https://discuss.hashicorp.com/t/vault-initial-token/45373 "2022-10-09T22:50:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tirelibirefe](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/tirelibirefe/32/23831_2.png) [@tirelibirefe](https://discuss.hashicorp.com/u/tirelibirefe)\
**Post date:** [October 9, 2022, 10:50pm UTC](https://discuss.hashicorp.com/t/vault-initial-token/45373/1 "2022-10-09T22:50:59Z")

</div>

Hello,  
I haven’t touched to Vault for a while and today when I attempt to login Vault by using Initial Root Token, I get the following error:

```auto
/ $ vault login
Token (will be hidden): 
Error authenticating: error looking up token: Get "https://127.0.0.1:8200/v1/auth/token/lookup-self": 
x509: certificate has expired or is not yet valid: current time 2022-10-09T22:49:58Z is after 2022-08-17T19:34:22Z
/ $ vault token create
Error creating token: Post "https://127.0.0.1:8200/v1/auth/token/create": x509: certificate has expired or is not yet valid: current time 2022-10-09T22:51:15Z is after 2022-08-17T19:34:22Z
/ $ 

```

Could you please advise how can I produce a new initial token?

Thanks & Regards

---

<div class="post-metadata">

**Author:** ![stuart-c](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/stuart-c/32/10789_2.png) [@stuart-c](https://discuss.hashicorp.com/u/stuart-c)\
**Post date:** [October 10, 2022, 8:29am UTC](https://discuss.hashicorp.com/t/vault-initial-token/45373/2 "2022-10-10T08:29:03Z")

</div>

As the error says your TLS certificate has expired.

You will need to get a replacement certificate issued and then update the files/restart Vault.

---

<div class="post-metadata">

**Author:** ![tirelibirefe](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/tirelibirefe/32/23831_2.png) [@tirelibirefe](https://discuss.hashicorp.com/u/tirelibirefe)\
**Post date:** [October 27, 2022, 7:53pm UTC](https://discuss.hashicorp.com/t/vault-initial-token/45373/3 "2022-10-27T19:53:05Z")

</div>

Hello,  
thanks for your answer @stuart-c but unfortunately not so simple.

The cert was renewed by cert-manager automaticialy but vault is not aware of the cert was renewed. I delete vault pods, k8s re-creates the pods, the secret/cert is read by Vault and it works.

Is there any way to fix that problem?

Thanks & Regards

---

<div class="post-metadata">

**Author:** ![stuart-c](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/stuart-c/32/10789_2.png) [@stuart-c](https://discuss.hashicorp.com/u/stuart-c)\
**Post date:** [October 28, 2022, 8:02am UTC](https://discuss.hashicorp.com/t/vault-initial-token/45373/4 "2022-10-28T08:02:45Z")

</div>

You would need to look at the cert-manager configuration to see if it can restart pods when a certificate gets renewed. I’m sure there are some other tools which could be used to detect such changes and restart the pods too.

---

<div class="post-metadata">

**Author:** ![tirelibirefe](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/tirelibirefe/32/23831_2.png) [@tirelibirefe](https://discuss.hashicorp.com/u/tirelibirefe)\
**Post date:** [October 29, 2022, 4:20pm UTC](https://discuss.hashicorp.com/t/vault-initial-token/45373/5 "2022-10-29T16:20:28Z")

</div>

how can cert-manager know the certificate is being used Vault or something else?

Can you please advise an sample configuration?

Thx & Regards
