If you use Debian, make sure that OpenSSL configuration file exists. If not, like here:
# ls -l /usr/lib/ssl/openssl.cnf
lrwxrwxrwx 1 root root 20 Mar 29 12:51 /usr/lib/ssl/openssl.cnf -> /etc/ssl/openssl.cnf
# ls -l /etc/ssl/openssl.cnf
ls: cannot access /etc/ssl/openssl.cnf: No such file or...