Create self signed certificate with openssl


1. Create private key

openssl genrsa -des3 -out domain.key 2048


2. Creating a Certificate Signing Request (CSR)

2.1 Create CSR configuration file

cat > certsr.conf <<EOF [ req ] default_bits = 2048 prompt = no default_md = sha256 req_extensions = req_ext distinguished_name = dn [ dn ] C = Co ST = State L = City O = Organisation OU = Org Unit CN = site.domain.com [ req_ext ] subjectAltName = @alt_names [ alt_names ] DNS.1 = site.domain.com DNS.2 = webmail.domain.com IP.1 = 192.168.10.2 IP.2 = 192.168.10.3 EOF

2.2 Create CSR

openssl req -key domain.key -new -out domain.csr -config certsr.conf


3. View CSR:

openssl req -text -noout -verify -in domain.csr


4. Creating a Self-Signed Certificate

openssl x509 -signkey domain.key -in domain.csr -req -days 365 -out domain.crt -extensions req_ext -extfile certsr.conf


5. View certificates

openssl x509 -text -noout -in domain.crt



Comentarii

Postări populare de pe acest blog

Process Command Line Arguments in Python

SQL injection with UNION

Docker compose DNS resolution