unable to load Private Key - Openssl

This is a discussion on unable to load Private Key - Openssl ; Hi there, I'm trying to create a self-signed certificate but I'm having some troubles, the error I keep getting is: mymachine# openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095 Error opening Private Key privkey.pem 19996:error:02001002:system library:fopen:No such file ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: unable to load Private Key

  1. unable to load Private Key

    Hi there, I'm trying to create a self-signed certificate but I'm
    having some troubles, the error I keep getting is:

    mymachine# openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095
    Error opening Private Key privkey.pem
    19996:error:02001002:system library:fopen:No such file or
    directory:bss_file.c:352:fopen('privkey.pem','r')
    19996:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:354:
    unable to load Private Key

    I'm kinda new with this certificates and openssl thing but I've never
    had this error before,
    I hope someone could help me
    Thanks

    (sorry for my poor english)
    --
    Daniela
    __________________________________________________ ____________________
    OpenSSL Project http://www.openssl.org
    User Support Mailing List openssl-users@openssl.org
    Automated List Manager majordomo@openssl.org


  2. RE: unable to load Private Key

    As the error message says, you are getting this because the private key
    file (privkey.pem) does not exist (No such file).

    If you want to use this form of the command you must first generate the
    private key file.

    If you want to do it all at once then a slightly different form of the
    command is required (I will assume you want an RSA key - changes are
    required for DSA or ECC):

    openssl req -newkey rsa:2048 -keyout privkey.pem -out cacert.pem -x509
    -new -days 1095

    This will result in something that looks like this:

    Generating a 2048 bit RSA private key
    .............................+++
    ...................+++
    writing new private key to 'privkey.pem'
    Enter PEM pass phrase:
    Verifying - Enter PEM pass phrase:
    -----
    You are about to be asked to enter information that will be incorporated
    into your certificate request.
    What you are about to enter is what is called a Distinguished Name or a
    DN.
    There are quite a few fields but you can leave some blank
    For some fields there will be a default value,
    If you enter '.', the field will be left blank.
    -----
    Country Name (2 letter code) [AU]:
    State or Province Name (full name) [Some-State]:
    Locality Name (eg, city) []:
    Organization Name (eg, company) [Internet Widgits Pty Ltd]:
    Organizational Unit Name (eg, section) []:
    Common Name (eg, YOUR name) []:
    Email Address []:



    Regards
    Bill

    -----Original Message-----
    From: owner-openssl-users@openssl.org
    [mailtowner-openssl-users@openssl.org] On Behalf Of Daniela Gutierrez
    Sent: June 12, 2008 6:13 PM
    To: openssl-users@openssl.org
    Subject: unable to load Private Key

    Hi there, I'm trying to create a self-signed certificate but I'm
    having some troubles, the error I keep getting is:

    mymachine# openssl req -new -x509 -key privkey.pem -out cacert.pem -days
    1095
    Error opening Private Key privkey.pem
    19996:error:02001002:system library:fopen:No such file or
    directory:bss_file.c:352:fopen('privkey.pem','r')
    19996:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:354:
    unable to load Private Key

    I'm kinda new with this certificates and openssl thing but I've never
    had this error before,
    I hope someone could help me
    Thanks

    (sorry for my poor english)
    --
    Daniela
    __________________________________________________ ____________________
    OpenSSL Project http://www.openssl.org
    User Support Mailing List openssl-users@openssl.org
    Automated List Manager majordomo@openssl.org
    __________________________________________________ ____________________
    OpenSSL Project http://www.openssl.org
    User Support Mailing List openssl-users@openssl.org
    Automated List Manager majordomo@openssl.org


+ Reply to Thread