Я пытаюсь создать новый сертификат SSL с openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt
.
Я получаю эту ошибку вывода:
Can't open /usr/lib/ssl/openssl.cnf for reading, No such file or directory
140188383974784:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:74:fopen('/usr/lib/ssl/openssl.cnf','r')
140188383974784:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:81:
Generating a RSA private key
...................................+++++
....................................................................+++++
writing new private key to '/etc/ssl/private/apache-selfsigned.key'
-----
unable to find 'distinguished_name' in config
problems making Certificate Request
140188383974784:error:0E06D06A:configuration file routines:NCONF_get_string:no conf or environment variable:../crypto/conf/conf_lib.c:272:
Как я могу это исправить ?
В /usr/lib/ssl/openssl.cnf
файл (который должен быть символической ссылкой на /etc/ssl/openssl.cnf
) отсутствует, поэтому openssl не может прочитать его конфигурацию. Я не уверен, как вам удалось его удалить, но я думаю, что самое верное решение - переустановить openssl
package с помощью следующей команды (я предполагаю, что вы используете систему на основе Debian):
sudo apt install openssl --reinstall