Skip to content

Instantly share code, notes, and snippets.

@whiler
Created May 26, 2023 11:07
Show Gist options
  • Save whiler/3a5b763598ce15595bf343a13243ce5d to your computer and use it in GitHub Desktop.
Save whiler/3a5b763598ce15595bf343a13243ce5d to your computer and use it in GitHub Desktop.
一行命令生成自签名的 ECC TLS 证书
#!/bin/bash
openssl req \
-new \
-newkey ec \
-pkeyopt ec_paramgen_curve:secp384r1 \
-sha256 \
-days 92 \
-nodes \
-x509 \
-subj "/CN=localhost" \
-addext "subjectAltName=DNS:*.localhost,IP:127.0.0.1" \
-keyout server.key.pem \
-out server.cert.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment