Skip to content

Commit

Permalink
Merge pull request #43 from malscent/main
Browse files Browse the repository at this point in the history
Added a check for server version 7.1 to use TLS
  • Loading branch information
malscent authored Apr 28, 2022
2 parents eb06faf + abae041 commit d3a3721
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,19 @@ then
# See MB-38001 - Must pass http:// and port 8091 to get it to not try to use tls in 7.0.0+
# Since we have to be backward compatible, we're going to fall back to http only for now and
# remove in the future
# The future has come. We're going to check version and if 7.1.0+ we're going to use https
greaterThan71=$(__compareVersions 7.1.0 "$VERSION")
cluster="http://$CLUSTER_HOST:8091"
serverAdd="http://$LOCAL_IP:8091"
if [[ "$greaterThan71" -le "0" ]]; then
cluster="https://$CLUSTER_HOST"
serverAdd="https://$LOCAL_IP"
fi
if output=$(./couchbase-cli server-add \
--cluster="http://$CLUSTER_HOST:8091" \
--cluster="$cluster" \
--username="$CB_USERNAME" \
--password="$CB_PASSWORD" \
--server-add="http://$LOCAL_IP:8091" \
--server-add="$serverAdd" \
--server-add-username="$CB_USERNAME" \
--server-add-password="$CB_PASSWORD" \
--services="$SERVICES" 2>&1); then
Expand Down

0 comments on commit d3a3721

Please sign in to comment.