0

I want to load a self-signed certificate created by OpenSSL to the local windows cert storage.

OpenSSL: 1.0.1l 

OS: Windows 7 N

I created the certificate with the OpenSSL library and used the following commands:

openssl genrsa -des3 -out mykey.key 2048

openssl req -new -key mykey.key -out mycert.crt

Now i tried to load the certificate into the storage via mmc.exe but it failed for the following reason:

"The file type not identifiable. Choose another file" (It's not the original text because I am not using english on my OS.)

I tried this with every "acceptable" file type.

So my thoughts were that Windows wants the key and the cert merged together. I don't know how certificates in Windows getting handled internally. (I know it's bullshit to provide private key in a certificate but i just kept trying.)

So i tried this to merge the files: (According to this post.)

openssl pkcs12 -inkey mykey.key -in mycert.crt export -out outputfile.crt/pkcs ...

But then the following error occurred:

unable to load certificates

Seems not working. Any suggestions how I can load certificate the local storage?

Also I would like to know if its possible to create a machine-certificate (PeterPan-PC or 192.168.2.1 instead of the Windows username (PeterPan)) with OpenSSL?

UPDATE:

With the following command a certificate request was created:

openssl req -new -key mykey.key -out mycert.crt

By using the following command, a self-signed certificate will be created and the issue is solved:

openssl req -new -x509 -key mykey.key -out mycert.crt -days 365
Community
  • 1
  • 1
Leviathan
  • 928
  • 1
  • 6
  • 15
  • 2
    openssl req -new -key mykey.key -out mycert.crt creates a certificate signing request and not a certificate. You can follow http://www.akadia.com/services/ssh_test_certificate.html to create a self signed certificate(upto step 4) – Yuvika Mar 15 '15 at 17:50
  • You are fully right. I already solved the issue.. but I unforunatly forgot to update my question. Thanks for reminding me! – Leviathan Mar 16 '15 at 09:41
  • ok great. Added it as an answer as it fixed ur issue. @Leviathan – Yuvika Mar 17 '15 at 07:21

1 Answers1

1

openssl req -new -key mykey.key -out mycert.crt creates a certificate signing request and not a certificate. You can follow http://www.akadia.com/services/ssh_test_certificate.html to create a self signed certificate(upto step 4)

Yuvika
  • 5,624
  • 2
  • 16
  • 21