Skip to content

Instantly share code, notes, and snippets.

@thekavish
Created September 29, 2022 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thekavish/861cf9681249465fda8d7f8bfabd144a to your computer and use it in GitHub Desktop.
Save thekavish/861cf9681249465fda8d7f8bfabd144a to your computer and use it in GitHub Desktop.
SSL Certificate in localhost
<VirtualHost _default_:443>
DocumentRoot "C:\xampp74\htdocs\myapp\public"
ServerName myapp.test
<Directory "C:\xampp74\htdocs\myapp\public"></Directory>
SSLEngine on
SSLCertificateFile "C:/xampp74/apache/conf/ssl.key/myapp.test.crt"
SSLCertificateKeyFile "C:/xampp74/apache/conf/ssl.key/myapp.test.key"
</VirtualHost>
# Refer -> https://zeropointdevelopment.com/how-to-get-https-working-in-windows-10-localhost-dev-environment/
# winpty openssl req -new -sha256 -nodes -out idb-app.test.csr -newkey rsa:2048 -keyout myapp.test.key -subj "/ST=Jharkhand/C=IN/L=Ranchi/O=Alight Solutions/OU=iDB/CN=myapp.test/emailAddress=hello@myapp.test"
# winpty openssl x509 -req -in myapp.test.csr -CA rootSSL.pem -CAkey rootSSL.key -CAcreateserial -out myapp.test.crt -days 512 -sha256 -extensions "authorityKeyIdentifier=keyid,issuer\n basicConstraints=CA:FALSE\n keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment\n subjectAltName=DNS:myapp.test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment