Error opening CA private key on Ubuntu

I am trying to create a self-signed certificate using OpenSSL on Ubuntu 14.04. When I enter the command openssl ca -in tempreq.pem -out server_crt.pem, I get the following error:

Using configuration from /root/myCA/caconfig.cnf  
**Error opening CA private key** ~/myCA/private/cakey.pem  
139754719667872:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('~/myCA/private/cakey.pem','r')  
139754719667872:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:  
unable to load CA private key

I have already confirmed that the command nano ~/myCA/private/cakey.pemopens the file cakey.pemand allows read permission for this file.

Any help would be appreciated. Thank!

+4
source share
1 answer

It seems that you are running root, make sure that you did not accidentally follow the instructions in the Ubuntu.com OpenSSL article, and set the dir parameter in /root/myCA/caconfig.cnf in / home / root / myCA.

, . , /home/root/myCA, , /root/myCA.

( ):

"~" , openssl. , .

+5

Source: https://habr.com/ru/post/1570789/


All Articles