Skip to content

Instantly share code, notes, and snippets.

@richardcurteis
Created November 18, 2021 11:30
Show Gist options
  • Save richardcurteis/cbd92a8c56782b2fa0cce85ecb93464d to your computer and use it in GitHub Desktop.
Save richardcurteis/cbd92a8c56782b2fa0cce85ecb93464d to your computer and use it in GitHub Desktop.
Generating certificates and CSRs with extended key usage flags. -des3 is removed from genrsa lines to prevent password prompts
openssl genrsa -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -addext 'extendedKeyUsage=1.3.6.1.5.5.7.3.4,1.3.6.1.5.5.7.3.2'
openssl genrsa -out client.key 4096
openssl req -new -key client.key -out client.csr
# self-signed
openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment