Skip to content

Instantly share code, notes, and snippets.

@coder4web
Last active September 19, 2022 13:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save coder4web/2694ea9170d2e34160749765dbb5d065 to your computer and use it in GitHub Desktop.
Save coder4web/2694ea9170d2e34160749765dbb5d065 to your computer and use it in GitHub Desktop.
Create a self-signed ECC certificate
#!/bin/sh
# Private key
openssl ecparam -genkey -name secp384r1 -out nginx.ec.key
openssl ec -in nginx.ec.key -text -noout
# CSR
openssl req -new -sha256 -key nginx.ec.key -subj "/CN=devops/C=BM/ST=Bermudian/L=Bermudian/O=Org/OU=IT" -out nginx.ec.csr
#openssl req -in nginx.ec.csr -text -noout
openssl req -in nginx.ec.csr -text -noout | grep -i "Signature.*SHA256" && echo "All is well"
# Certificate
openssl req -x509 -sha256 -days 365 -key nginx.ec.key -in nginx.ec.csr -out nginx.ec.crt
# nginx conf
#ssl_certificate /etc/nginx/ssl/nginx.ec.crt;
#ssl_certificate_key /etc/nginx/ssl/nginx.ec.key;
openssl s_client -connect site.domain:443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment