Created
November 7, 2018 09:36
-
-
Save mnlcandelaria/770ace40a9af1f2393c33626099820bf to your computer and use it in GitHub Desktop.
Self Signed Certificate Mac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /tmp/crt && cd /tmp/crt | |
# Wildcard SSL certificate | |
sudo openssl req -subj "/commonName=Local Certificate/" -x509 -nodes -days 730 -newkey rsa:2048 -keyout /server/conf/cert/server.key -out /server/conf/cert/server.crt | |
sudo mkdir /etc/apache2/ssl | |
sudo mv *.key *.crt /etc/apache2/ssl | |
# uncomment on Apache Configuration | |
sudo nano /etc/apache2/httpd.conf | |
LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so | |
LoadModule ssl_module libexec/apache2/mod_ssl.so | |
Include /private/etc/apache2/extra/httpd-ssl.conf | |
# checking error | |
apachectl configtest | |
# update virtual host | |
<VirtualHost *:443> | |
ServerAlias * | |
VirtualDocumentRoot /server/hosts/%0/current | |
VirtualScriptAlias /server/hosts/%0/current | |
SSLEngine on | |
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL | |
SSLCertificateFile /etc/apache2/ssl/server.crt | |
SSLCertificateKeyFile /etc/apache2/ssl/server.key | |
<Directory "/server/hosts/"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
#Order allow,deny | |
#Allow from all | |
Require all granted | |
</Directory> | |
</VirtualHost> | |
# Chrome / Safari Configuration | |
open /etc/apache2/ssl | |
open /Applications/Utilities/Keychain\ Access.app | |
# Double click, and change the settings for the selected certificate to "Always Trust". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment