Skip to content

Instantly share code, notes, and snippets.

@mthabsheer
Created April 21, 2021 09:48
Show Gist options
  • Save mthabsheer/4333a1f22f7c609932ed177103b618b8 to your computer and use it in GitHub Desktop.
Save mthabsheer/4333a1f22f7c609932ed177103b618b8 to your computer and use it in GitHub Desktop.
SSL generation
#Compared a Key with certificate
__The below 2 commands hashed and if it matches then the private key and certificate are matching.__
openssl pkey -in privateKey.key -pubout -outform pem | sha256sum
openssl x509 -in cert.crt -pubkey -noout -outform pem | sha256sum
#Create CSR from existing key file
openssl req -key domain.key -new -out domain.csr
#Generate CSR
openssl req -newkey rsa:2048 -keyout PRIVATEKEY.key -out MYCSR.csr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment