slepciu
4/25/2017 - 6:28 AM

Add ssl to vagrant

Add ssl to vagrant

openssl req -newkey rsa:2048 -x509 -nodes -keyout wa2-api.local.key -new -out wa2-api.local.cert -subj /CN=wa2-api.local -reqexts SAN -extensions SAN -config <(cat /etc/ssl/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:wa2-api.local')) -sha256 -days 3650
sudo a2enmod ssl
sudo openssl genrsa -out "devcert.key" 2048
sudo openssl req -new -key "devcert.key" -out "devcert.csr"
> Common Name: *.local
sudo openssl x509 -req -days 365 -in "devcert.csr" -signkey "devcert.key" -out "devcert.crt"

dodać w vhost:

<VirtualHost *:443>
 .....
    <Directory "/var/www/api/public/frontend/web">
        Options Indexes FollowSymLinks MultiViews
        Require all granted
        AllowOverride All
        Allow from All
    </Directory>
    #adding custom SSL cert
    SSLEngine on
    SSLCertificateFile /home/vagrant/wa2-api.dev.cert
    SSLCertificateKeyFile /home/vagrant/wa2-api.dev.key
</VirtualHost>