Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to configure openssl path #112

Merged
merged 2 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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