Giter Site home page Giter Site logo

react-with-ssl-container's Introduction

Credits

https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309 https://hub.docker.com/_/httpd

Steps to deal with SSL certs.

  1. Create a root CA key:

openssl genrsa -des3 -out containerCA.key 4096

  1. Create a root CA certificate:

openssl req -x509 -new -nodes -key containerCA.key -sha256 -days 1024 -out containerCA.crt

  1. Create a container key:

openssl genrsa -out container.key 2048

  1. Create a container CSR that specifies SANs (because Chrome is a pain).

openssl req -new -sha256
-key container.key
-subj "/C=US/ST=Kentucky/O=Container/OU=Container/CN=docker.container"
-reqexts SAN
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=DNS:docker.container"))
-out container.csr

  1. Create a container certificate using that CSR and specifying SANs:

openssl x509 -req -extfile <(printf "subjectAltName=DNS:docker.container") -days 1200 -in container.csr -CA containerCA.crt -CAkey containerCA.key -CAcreateserial -out container.crt -sha256

  1. Import the container root cert in to your trusted root certification authorities.

  2. Import the container certificate in to your Personal Certificates.

  3. Profit.

Steps to deal with HTTPD setup

  1. Copy the static HTML files in to /usr/local/apache2/htdocs/

  2. Copy the container cert and key in to /usr/local/apache2/conf/

  3. In httpd.conf, uncomment the following lines:

    • #LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

    • #LoadModule ssl_module modules/mod_ssl.so

    • #Include conf/extra/httpd-ssl.conf

  4. In httpd-ssl.conf, make sure that SSLCertificateFile and SSLCertificateKeyFile point to the right location.

  5. Copy httpd.conf to /usr/local/apache2/conf/

  6. Copy http-ssl.conf to /usr/local/apache2/conf/extra/

DNS updates

Update your HOSTS file to deal with docker.container being pointed at 127.0.0.1.

Build and Run

react-with-ssl-container's People

Contributors

am1983 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.