Created an OpenVPN client certificate, need to replace it

Scripts to manage certificates or generate config files

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Locked
jompsi
OpenVPN User
Posts: 28
Joined: Mon Jan 27, 2014 9:23 am

Created an OpenVPN client certificate, need to replace it

Post by jompsi » Thu May 15, 2014 8:24 am

Hello community

I have a Certification Authority. On this one I created a certificate with the following command:

Code: Select all

./build-key-pkcs12 tab2.company
Then I created with a Password Generator a complicated password :) Unfortunately it was so complicated, that i wasnt able to type it in twice correctly :(
But it created tab2.company.p12, tab2.company.key, tab2.company.csr and tab2.company.crt anyway.
Now, the password for tab2.company.p12 is wrong and I am not able to connect to the openvpn with tab2.company.key and tab2.company.crt and of course ca.crt either. The .p12 File is not the most important. I am just happy, if I can connect with tab2.company.key, tab2.company.crt and ca.crt.

If I try to create the tab2.ompex certificate again, there appears an error. My goal is, to create the certificate again and clean with the same name, so the name policy in our company is clean.

Do you have any idea, how I can make it run? Or is the only possibility to create a new certificate with another name?

Thanks in advance for your help :) If you need more informations, please ask.

Nice regards
jompsi

jompsi
OpenVPN User
Posts: 28
Joined: Mon Jan 27, 2014 9:23 am

Re: Created an OpenVPN client certificate, need to replace i

Post by jompsi » Thu Jun 19, 2014 10:30 am

Hello all

I found the solution :)

First of all you need to switch in the "key" directory of your CA.

Then make a backup of index.txt(for example index.txt.bkp).
After this, open the index.txt. There you should find the following entry:

Code: Select all

V       XXXXXXXXXXXXXXX           06      unknown /XXXXX/XXXXX/XXXXX/XXXXXXXX/XXXXXXXX/CN=tab2.company/XXXXXXXXX/XXXXXXXXXXXXXXXX
This entry you can delete.

Afterwards you have to move/delete this files:
  • tab2.company.key
    tab2.company.csr
    tab2.company.crt
    tab2.company.p12
    06.pem(you find this number in the line above)
Now you can execute ". ./vars" again and you are ready to create the certificate again with the same name :)

I hope this is usefull to some of you.

This question can be closed.

Kind regards
jompsi

Locked