From dae913317e5b582dd4ef1d270a52ad93ad62842e Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Wed, 8 May 2024 16:33:43 +0500 Subject: [PATCH] Generate local certs for LAN https access --- basic_configs/ssl/gen.fish | 9 +++++++++ basic_configs/ssl/local_cert.cnf | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 basic_configs/ssl/gen.fish create mode 100644 basic_configs/ssl/local_cert.cnf diff --git a/basic_configs/ssl/gen.fish b/basic_configs/ssl/gen.fish new file mode 100755 index 0000000..10b0847 --- /dev/null +++ b/basic_configs/ssl/gen.fish @@ -0,0 +1,9 @@ +#!/usr/bin/fish + +openssl genrsa -out key.pem 2048 + +openssl req -new -out server.csr -key key.pem -config local_cert.cnf + +openssl x509 -req -days 9999 -in server.csr -signkey key.pem -out cert.pem -extensions v3_req -extfile local_cert.cnf + +rm server.csr diff --git a/basic_configs/ssl/local_cert.cnf b/basic_configs/ssl/local_cert.cnf new file mode 100644 index 0000000..359ec0d --- /dev/null +++ b/basic_configs/ssl/local_cert.cnf @@ -0,0 +1,20 @@ +[ req ] +default_bits = 2048 + +prompt = no +distinguished_name = req_distinguished_name +req_extensions = v3_req + +[req_distinguished_name] +countryName = PK +stateOrProvinceName = Sindh +localityName = Karachi +commonName = 272254864.xyz + +[v3_req] +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +subjectAltName = @alt_names + +[alt_names] +DNS.1 = *.272254864.xyz