Permalink
Browse files

Merge changes.

  • Loading branch information...
greboid committed Dec 9, 2018
2 parents fec9c4f + eea75a6 commit ee6ca5258ebe520df94260159da96041d2cf0219
Showing with 14 additions and 7 deletions.
  1. +3 −3 Dockerfile
  2. +11 −4 ssl.sh
@@ -31,10 +31,10 @@ RUN \

EXPOSE 33262 33263

WORKDIR /var/lib/dfbnc
COPY ssl.sh /home/dfbnc/ssl.sh

COPY ssl.sh /var/lib/dfbnc/ssl.sh
WORKDIR /var/lib/dfbnc

RUN /var/lib/dfbnc/ssl.sh
ENTRYPOINT ["/home/dfbnc/ssl.sh"]

CMD ["/usr/bin/java", "-jar", "/home/dfbnc/dfbnc.jar", "--config", "/var/lib/dfbnc", "--foreground"]
15 ssl.sh
@@ -1,7 +1,14 @@
#!/bin/sh
set -e

REQUESTOU=${OU:="/C=GB/ST=DFBnc/L=DFBnc/O=DFBnc/OU=DFBnc/CN=dfbnc"}
openssl req -new -passout pass:password -newkey rsa:2048 -keyout key.pem -x509 -days 3650 -out certificate.pem -subj "$REQUESTOU"
openssl pkcs12 -inkey key.pem -in certificate.pem -export -out /home/dfbnc/keystore.p12 -password pass:password -passin pass:password
rm certificate.pem
rm key.pem
FILE=".keystore.p12"

if [ ! -f $FILE ]; then
openssl req -new -passout pass:password -newkey rsa:2048 -keyout key.pem -x509 -days 3650 -out certificate.pem -subj "$REQUESTOU"
openssl pkcs12 -inkey key.pem -in certificate.pem -export -out $FILE -password pass:password -passin pass:password
rm certificate.pem
rm key.pem
fi

exec "$@"

0 comments on commit ee6ca52

Please sign in to comment.