ssl

Moderator: frogmaker

pi
Moderator
Moderator
Posty: 18
Rejestracja: 09 sty 2018, 9:44

ssl

Post autor: pi »

Step 1: Create the SSL Certificate
TLS/SSL works by using a combination of a public certificate and a private key. The SSL key is kept secret on the server. It is used to encrypt content sent to clients. The SSL certificate is publicly shared with anyone requesting the content. It can be used to decrypt the content signed by the associated SSL key.

We can create a self-signed key and certificate pair with OpenSSL in a single command:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt


/etc/apache2/site-enabled/site-conf - set paths for key and cert files

set https .htaccess file:
RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

or http:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Awatar użytkownika
jurek
Administrator
Administrator
Posty: 104
Rejestracja: 17 maja 2009, 15:48
Lokalizacja: Piast

Re: ssl

Post autor: jurek »

certBot
Awatar użytkownika
jurek
Administrator
Administrator
Posty: 104
Rejestracja: 17 maja 2009, 15:48
Lokalizacja: Piast

Re: ssl

Post autor: jurek »

Aby dodać protokół ssl do nowej strony:

Kod: Zaznacz cały

sudo certbot --apache
ODPOWIEDZ