Как я могу использовать TLS на локальном сервере разработки Apache (на локальном хосте)

Если вы используете ОС на основе systemd, например Ubuntu 16.04 или Debian 9, вам нужно будет использовать команду systemctlвместоservice:

Для включения во время загрузки:

systemctl enable openvpn@server.service

Для запуска и остановки вручную:

systemctl start openvpn@server.service

systemctl stop openvpn@server.service

Таким образом, вы можете включать, отключать, запускать и останавливать любую конфигурацию OpenVPN, заменив serverименем файла .confв /etc/openvpn.

0
08.03.2019, 10:11
1 ответ

Самый простой способ — создать самоподписанный сертификат и добавить его на веб-сервер. И не забудьте добавить его в браузер (, чтобы избежать )предупреждающих сообщений.

Вы можете проверить здесь , как это сделать

You can do that in one command:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365

You can also add -nodes (short for no DES) if you don't want to protect your private key with a passphrase. Otherwise it will prompt you for "at least a 4 character" password.

The days parameter (365) you can replace with any number to affect the expiration date. It will then prompt you for things like "Country Name", but you can just hit Enter and accept the defaults.

Add -subj '/CN=localhost' to suppress questions about the contents of the certificate (replace localhost with your desired domain).

Self-signed certificates are not validated with any third party unless you import them to the browsers previously. If you need more security, you should use a certificate signed by a certificate authority (CA).

1
28.01.2020, 02:40

Теги

Похожие вопросы