Linux - https - how to generate self-signed certificate

Linux - https - how to generate self-signed certificate

Hello, I need to generate a self-signed certificate on Linux for HTTPS access to my nextcloud. I do not mind that the certificate will be untrustworthy. Please proceed as quickly as possible. Thank you

REPLY


Hello,

to generate a self-signed certificate for https would be like this:

1.) Generated a certificate for 10 years
openssl req -x509 -nodes -days 3650 -newkey rsa: 2048 -keyout /etc/ssl/certs/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

2.) Generate dhparam.pem
openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

3.) Set up virtualhost for webserver, here for nginx:


server {
listen 80;
listen [::]:80;

listen 443 ssl;
listen [::]:443 ssl;
root /var/www/myweb;
index index.php index.html;
server_name cloud.up4.cz;

ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/certs/nginx-selfsigned.key;
ssl_dhparam /etc/ssl/certs/dhparam.pem;

location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}

location ~ /\.ht {
deny all;
}
}


Související obsah

linux

bash

terminal

webserver

https

ssl

Komentáře

Vaše reakce na Linux - https certifikát podepsaný sám sebou (self-signed certificate)

Reference

Podívejte se na naše reference

Prohlédnout

Aplikace

Podívejte se na naše aplikace

Prohlédnout

Co umíme?

Podívejte se co umíme

Prohlédnout

Co umíme?

Vytváříme sofistikované aplikace pro náročné

Od webových aplikací přes android až po převodové můstky či složité informační systémy.

Podívejte se k nám

Máte ještě čas? Podívejte se na další rubriky

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.