Skip to content

Commit

Permalink
Adding support to configure openssl path (#112)
Browse files Browse the repository at this point in the history
* Update ha.sh

* Update replicate.sh
  • Loading branch information
nayasam authored Jan 5, 2021
1 parent 51c3122 commit 2821449
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#
SSH=ssh
SCP=scp
OPENSSL=openssl

#
# if this file exists, source it to set any local customizations to the execution environment
Expand Down
10 changes: 5 additions & 5 deletions replicate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1764,8 +1764,8 @@ if $ssl_replication ; then
#
# make a CA
#
openssl genrsa 2048 > $CERTS/ca-key.pem 2>/dev/null
openssl req -new -x509 -nodes -days 3650 \
$OPENSSL genrsa 2048 > $CERTS/ca-key.pem 2>/dev/null
$OPENSSL req -new -x509 -nodes -days 3650 \
-key $CERTS/ca-key.pem -out $CERTS/ca-cert.pem -subj "/CN=ca" >/dev/null 2>&1

#
Expand All @@ -1774,11 +1774,11 @@ if $ssl_replication ; then
for cn in $primary $secondary ; do
base=$CERTS/$cn
echo "making host $cn keypair"
openssl req -newkey rsa:2048 \
$OPENSSL req -newkey rsa:2048 \
-subj "/CN=$cn" -nodes -days 3650 \
-keyout $base-private.pem -out $base-public.pem >/dev/null 2>&1
openssl rsa -in $base-private.pem -out $base-private.pem >/dev/null 2>&1
openssl x509 -req -days 3560 -set_serial 01 \
$OPENSSL rsa -in $base-private.pem -out $base-private.pem >/dev/null 2>&1
$OPENSSL x509 -req -days 3560 -set_serial 01 \
-in $base-public.pem -out $base-cert.pem \
-CA $CERTS/ca-cert.pem -CAkey $CERTS/ca-key.pem >/dev/null 2>&1
done
Expand Down

0 comments on commit 2821449

Please sign in to comment.