0

Create key and certificate:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
Can't open /usr/lib/ssl/openssl.cnf for reading, No such file or directory
140713226073408:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/usr/lib/ssl/openssl.cnf','r')
140713226073408:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:

Reinstall it with:

apt install openssl --reinstall

Check the file with:

ls -al  /usr/lib/ssl/openssl.cnf
lrwxrwxrwx 1 root root 20 Mar 19 02:25 /usr/lib/ssl/openssl.cnf -> /etc/ssl/openssl.cnf
ls -al /etc/ssl/openssl.cnf
ls: cannot access '/etc/ssl/openssl.cnf': No such file or directory

How can solve the issue then?

1

3 Answers 3

3

Download the file from https://github.com/openssl/openssl/blob/master/apps/openssl.cnf, maybe changing the branch to suit your version (as retrieved with openssl version).

Save it as /etc/ssl/openssl.cnf.

Alternatively, you could search your system for the file with:

find / -iname openssl.cnf

If you are lucky enough to find it, many of the openssl commands accept the -config option to point to an alternative file; or you could simply move it to it's correct home.

1

You can find the openssl.cnf path like this

$ openssl version -d

OPENSSLDIR: "/etc/pki/tls"

0
  1. url address

The url should be https://raw.githubusercontent.com/openssl/openssl/master/apps/openssl.cnf.

  1. target directory

It should be /usr/lib/ssl/openssl.cnf instead of /etc/ssl/openssl.cnf.

curl -k  https://raw.githubusercontent.com/openssl/openssl/master/apps/openssl.cnf       
-o  /usr/lib/ssl/openssl.cnf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.