Setting up localhost SSL Cert: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Created page with "Create a file server.csr.cnf <syntaxhighlight code=""> openssl genrsa [req] default_bits = 2048 prompt = no default_md = sha256 distinguished_name = dn [dn] C=US ST=RandomSta..."
 
No edit summary
Line 1: Line 1:
Create a file server.csr.cnf
=Create a file server.csr.cnf=
<syntaxhighlight code="">
<syntaxhighlight code="">
openssl genrsa
openssl genrsa
Line 18: Line 18:
</syntaxhighlight>
</syntaxhighlight>


Create a file v3.ext
=Create a file v3.ext=
<syntaxhighlight code="">
<syntaxhighlight code="">
authorityKeyIdentifier=keyid,issuer
authorityKeyIdentifier=keyid,issuer
Line 29: Line 29:
</syntaxhighlight>
</syntaxhighlight>


=run the following=
<syntaxhighlight code="bash">
<syntaxhighlight code="bash">
openssl genrsa -des3 -out rootCA.key 2048
openssl genrsa -des3 -out rootCA.key 2048

Revision as of 21:09, 13 October 2020

Create a file server.csr.cnf

openssl genrsa
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn

[dn]
C=US
ST=RandomState
L=RandomCity
O=RandomOrganization
OU=RandomOrganizationUnit
emailAddress=hello@example.com
CN = localhost

Create a file v3.ext

authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost

run the following

openssl genrsa -des3 -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config <( cat server.csr.cnf )
openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256 -extfile v3.ext