Skip to content

Instantly share code, notes, and snippets.

@lucasmartins1994
Last active May 6, 2019 12:49
Show Gist options
  • Save lucasmartins1994/b7ee5d01a3e43ff30576f57d05efedd3 to your computer and use it in GitHub Desktop.
Save lucasmartins1994/b7ee5d01a3e43ff30576f57d05efedd3 to your computer and use it in GitHub Desktop.
  • Run this command to generate the key
openssl req \
    -newkey rsa:2048 \
    -x509 \
    -nodes \
    -keyout server.key \
    -new \
    -out server.crt \
    -subj /CN=dev.mycompany.com \
    -reqexts SAN \
    -extensions SAN \
    -config <(cat /System/Library/OpenSSL/openssl.cnf \
        <(printf '[SAN]\nsubjectAltName=DNS:dev.mycompany.com')) \
    -sha256 \
    -days 3650
  • Open on the mac -> keychain Access.app

  • Drag your server.crt and drop inside access.app

  • Double click in the certificate and mark "Always trust"

  • Open your vhost and configure your SSLCertificateFile

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "/etc/apache2/certs/server.crt"
SSLCertificateKeyFile "/etc/apache2/certs/server.key"
  • Restart your apache

  • In chrome go to development tools -> Application tab -> clear storage and "Clear site data"

  • Re-open your URL in chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment