Skip to content

Commit

Permalink
NA: Fix certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgrayston committed Nov 9, 2020
1 parent b26351f commit d223d14
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ FROM node:12-alpine

WORKDIR /usr/src/app

COPY ./ssl/openssl.cnf /etc/ssl/openssl.localhost.cnf
COPY . .

RUN apk --no-cache add openssl

RUN openssl req \
-config /etc/ssl/openssl.localhost.cnf \
-x509 \
-nodes \
-days 365 \
-sha256 \
-newkey rsa:2048 \
-keyout /etc/ssl/server.key \
-out /etc/ssl/server.crt \
-subj "/C=UK/ST=London/L=London/O=Yoti/OU=Yoti/CN=localhost"
-out /etc/ssl/server.crt

RUN npm install

Expand Down
37 changes: 37 additions & 0 deletions ssl/openssl.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[req]
default_bits = 2048
default_md = sha256
encrypt_key = no
prompt = no
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext

[ subject ]
C = UK
ST = London
L = London
O = Yoti
OU = Yoti
CN = localhost

[ req_ext ]
subjectKeyIdentifier = hash
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @alternate_names
nsComment = "Self-Signed SSL Certificate"

[ x509_ext ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @alternate_names
nsComment = "Self-Signed SSL Certificate"

[ alternate_names ]
DNS.1 = localhost
IP.1 = 127.0.0.1

0 comments on commit d223d14

Please sign in to comment.