Click here to Skip to main content
16,018,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dears,

There is an existing internal/local certificate that is used for encryption purposes on the windows server for the .NET applications. The request is to renew the certificate with the old private key.

I have tried the below OpenSSL cmd to generate the CSR with the old private key and it was successful but without SAN(subject Alternate name).

Can anyone please help to generate the CSR with SAN and use the old private key by using OpenSSL?

Thanks in advance.

What I have tried:

openssl x509 -x509toreq -in C:\existing.crt -signkey C:\existing.key -out C:\Cert-new.csr
Posted
Updated 14-Feb-23 0:12am

1 solution

Not my field of expertise but I think the following might help, we had a similar issue a while back.

Navigate to the directory where your current key file is located -
openssl req -new -key your_existing_key.key -out your_new_san_file_name.csr -config your_config_file_name.cnf


Set all your information in pop-ups that follows.
Open your config file and add the SAN's for your certificate under the alt_names section.
Submit the CSR to obtain your SAN.
 
Share this answer
 
v2
Comments
Abdulsubhan 029 15-Feb-23 2:48am    
I'm trying to import the old private key to the csr but no luck. Seek your help.

openssl x509 -x509toreq -in C:\existing.crt -signkey C:\existing.key -out C:\Cert-new.csr -config your_config_file_name.cnf
with SAN but I'm getting the error: "x509: Use -help for summary".
Andre Oosthuizen 15-Feb-23 3:17am    
Did you rename this - your_config_file_name.cnf?
Abdulsubhan 029 24-Feb-23 2:42am    
Yes

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900