How To Create SSL Certificate For Localhost

May 27,2021

Ryudith Tutorial

2016-07-10T09:17:04Z

How To Create SSL Certificate For Localhost

This video show how to create SSL certificate for localhost, which you can use for local development or internal application. First make sure you already install OpenSSL, hope this video can help you. :)

If you have some problems or difficulties or have some other questions then you can ask me in the comment bellow. I will try answer your questions. :)

Support me on https://ko-fi.com/iryudith


Config file example :
[dn]
CN=Ryudith
[req]
distinguished_name = dn
[EXT]
subjectAltName=DNS:localhost,IP:10.0.2.2
keyUsage=digitalSignature
extendedKeyUsage=serverAuth


Generate certificate command :

openssl req -x509 -out localhost_android.crt -keyout localhost_android.key -newkey rsa:2048 -days 1024 -nodes -sha256 -subj "/C=US/O=Dev-Certificate/CN=Ryudith" -extensions EXT -config config.txt


Apache VHost config example (please change angle brackets with angle brackets your keyboard if you copy-paste code) :
<VirtualHost *:443>
ServerName localhost:443
ServerAdmin [email protected]

SSLEngine on
SSLCertificateFile "[your_ssl_folder_location]/localhost.crt"
SSLCertificateKeyFile "[your_ssl_folder_location]/localhost.key"

DocumentRoot "[your_htdoc_folder_location]"
<Directory "[your_htdoc_folder_location]/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


OpenSSL download :
https://slproweb.com/products/Win32OpenSSL.html


OpenSSL options command :
https://www.openssl.org/docs/man1.1.0/man1/req.html


OpenSSL distinguished name :
https://www.ibm.com/docs/en/ibm-mq/7.5?topic=certificates-distinguished-names


#RYUDITHTUTORIAL

ryudithryudith tutorialtutorialprogramminginstallssl localhostapache sslopenssl windowsopenssl localhostapache httpshttpsssl consolessl certificatessl certificate freessl setuplocal ssl certificatessl error in firefoxapache vhost ssl configurationxampp vhost configandroid sslandroid import ssl certificatelocalhost httpslocalhost apache serverapache ssl onapache sslengine invalid command