ZacharyFolk / arto

Custom child theme for Wordpress Woocommerce shop
0 stars 0 forks source link

Create https for local #34

Closed ZacharyFolk closed 2 years ago

ZacharyFolk commented 2 years ago

Was able to set this up, this was helpful : https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/

In C:\xampp\apache\crt

cert.conf

[ req ]

default_bits        = 2048
default_keyfile     = server-key.pem
distinguished_name  = subject
req_extensions      = req_ext
x509_extensions     = x509_ext
string_mask         = utf8only

[ subject ]

countryName                 = Country Name (2 letter code)
countryName_default         = US

stateOrProvinceName         = State or Province Name (full name)
stateOrProvinceName_default = WA

localityName                = Locality Name (eg, city)
localityName_default        = Shoreline

organizationName            = Organization Name (eg, company)
organizationName_default    = Artological

commonName                  = Common Name (e.g. server FQDN or YOUR name)
commonName_default          = artological.dev

emailAddress                = Email Address
emailAddress_default        = artological.overseer@gmail.com

[ x509_ext ]

subjectKeyIdentifier   = hash
authorityKeyIdentifier = keyid,issuer

basicConstraints       = CA:FALSE
keyUsage               = digitalSignature, keyEncipherment
subjectAltName         = @alternate_names
nsComment              = "OpenSSL Generated Certificate"

[ req_ext ]

subjectKeyIdentifier = hash

basicConstraints     = CA:FALSE
keyUsage             = digitalSignature, keyEncipherment
subjectAltName       = @alternate_names
nsComment            = "OpenSSL Generated Certificate"

[ alternate_names ]

DNS.1       = artological.dev

make-cert.bat

@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=./../conf/openssl.cnf

if not exist .\%domain% mkdir .\%domain%

..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 3650 -out %domain%\server.crt

echo.
echo -----
echo The certificate was provided.
echo.
pause