From 9fc9ae063ebc2a2ee23b39f3dec48e3af7947adf Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Mon, 15 May 2017 23:04:35 +0800 Subject: [PATCH] [ci skip] Update man page --- man/ttyd.1 | 16 +++++++++------- man/ttyd.man.md | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/man/ttyd.1 b/man/ttyd.1 index c6a2546..324e464 100644 --- a/man/ttyd.1 +++ b/man/ttyd.1 @@ -150,14 +150,16 @@ Generate SSL CA and self signed server/client certificates: .nf # CA certificate (FQDN must be different from server/client) -openssl genrsa \-out ca.key 4096 -openssl req \-new \-x509 \-days 365 \-key ca.key \-out ca.crt -# server certificate -openssl req \-newkey rsa:2048 \-nodes \-keyout server.key \-out server.csr -openssl x509 \-req \-days 365 \-in server.csr \-CA ca.crt \-CAkey ca.key \-set\_serial 01 \-out server.crt +openssl genrsa \-out ca.key 2048 +openssl req \-new \-x509 \-days 365 \-key ca.key \-subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" \-out ca.crt + +# server certificate (for multiple domains, change subjectAltName to: DNS:example.com,DNS:www.example.com) +openssl req \-newkey rsa:2048 \-nodes \-keyout server.key \-subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=localhost" \-out server.csr +openssl x509 \-req \-extfile <(printf "subjectAltName=DNS:localhost") \-days 365 \-in server.csr \-CA ca.crt \-CAkey ca.key \-CAcreateserial \-out server.crt + # client certificate (the p12/pem format may be useful for some clients) -openssl req \-newkey rsa:2048 \-nodes \-keyout client.key \-out client.csr -openssl x509 \-req \-days 365 \-in client.csr \-CA ca.crt \-CAkey ca.key \-set\_serial 02 \-out client.crt +openssl req \-newkey rsa:2048 \-nodes \-keyout client.key \-subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=client" \-out client.csr +openssl x509 \-req \-days 365 \-in client.csr \-CA ca.crt \-CAkey ca.key \-CAcreateserial \-out client.crt openssl pkcs12 \-export \-clcerts \-in client.crt \-inkey client.key \-out client.p12 openssl pkcs12 \-in client.p12 \-out client.pem \-clcerts diff --git a/man/ttyd.man.md b/man/ttyd.man.md index b09aac1..2d1eb5c 100644 --- a/man/ttyd.man.md +++ b/man/ttyd.man.md @@ -102,14 +102,16 @@ ttyd -p 8080 bash -x ``` # CA certificate (FQDN must be different from server/client) -openssl genrsa -out ca.key 4096 -openssl req -new -x509 -days 365 -key ca.key -out ca.crt -# server certificate -openssl req -newkey rsa:2048 -nodes -keyout server.key -out server.csr -openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt +openssl genrsa -out ca.key 2048 +openssl req -new -x509 -days 365 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt + +# server certificate (for multiple domains, change subjectAltName to: DNS:example.com,DNS:www.example.com) +openssl req -newkey rsa:2048 -nodes -keyout server.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=localhost" -out server.csr +openssl x509 -req -extfile <(printf "subjectAltName=DNS:localhost") -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt + # client certificate (the p12/pem format may be useful for some clients) -openssl req -newkey rsa:2048 -nodes -keyout client.key -out client.csr -openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 02 -out client.crt +openssl req -newkey rsa:2048 -nodes -keyout client.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=client" -out client.csr +openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12 openssl pkcs12 -in client.p12 -out client.pem -clcerts ``` -- 2.43.4