Skip to content

Commit

Permalink
fix conflicts, add keys generation commands
Browse files Browse the repository at this point in the history
Signed-off-by: Firas Ghanmi <fghanmi@redhat.com>
  • Loading branch information
fghanmi committed Jul 30, 2024
1 parent 2d47d44 commit 3609bc5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions config/tls/key_cert_generation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generation of ct_server key/cert and CA certficate

## Commands

```
# 1. Generate CA's private key and self-signed certificate
openssl req -x509 -newkey rsa:4096 -days 36500 -nodes -keyout ca.key -out ca.crt -subj "/CN=My CA"
# 2. Generate ct_server's private key and certificate signing request (CSR)
openssl req -newkey rsa:4096 -nodes -keyout tls.key -out server-req.pem -subj "/=Server TLS/OU=Server/CN=*/emailAddress=tls@gmail.com"
# 3. SAN
echo "subjectAltName=DNS:*,DNS:ct_server,IP:0.0.0.0" > server-ext.cnf
# 3. Use CA's private key to sign ct_server's CSR and get back the signed certificate
openssl x509 -req -in server-req.pem -days 60 -CA ca.crt -CAkey ca.key -CAcreateserial -out tls.crt -extfile server-ext.cnf
# 4. Clean-up
rm ca.key ca.srl server-ext.cnf server-req.pem
```

0 comments on commit 3609bc5

Please sign in to comment.