Skip to content

Commit

Permalink
[FAB-2572] Update client/server TLS setting
Browse files Browse the repository at this point in the history
  Add setTLS routine to determine whether to
  set proto to http or https and whether or
  not to pass certificate parameters

Change-Id: I789da73755f2af6713c441d4846ab5e78d8cb3aa
Signed-off-by: rennman <eabailey@us.ibm.com>
  • Loading branch information
rennman committed Apr 6, 2017
1 parent 20a1b7a commit 06bb12f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/fvt/fabric-ca_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ function startHaproxy() {
local server_port=${USER_CA_PORT-$CA_DEFAULT_PORT}
#sudo sed -i 's/ *# *$UDPServerRun \+514/$UDPServerRun 514/' /etc/rsyslog.conf
#sudo sed -i 's/ *# *$ModLoad \+imudp/$ModLoad imudp/' /etc/rsyslog.conf
case $TLS_DISABLE in
false)
case $TLS_ON in
"true")
haproxy -f <(echo "global
log /dev/log local0 debug
log /dev/log local1 debug
Expand All @@ -239,7 +239,7 @@ backend fabric-cas
echo " server server$i 127.0.0.$i:$server_port"
done)
;;
true)
*)
haproxy -f <(echo "global
log /dev/log local0 debug
log /dev/log local1 debug
Expand Down Expand Up @@ -380,9 +380,9 @@ if test -n "$TLS_ON"; then
TLS_DISABLE='false'
else
case "$FABRIC_TLS" in
true) TLS_DISABLE='false' ;;
false) TLS_DISABLE='true' ;;
*) TLS_DISABLE='true' ;;
true) TLS_DISABLE='false';TLS_ON='true';LDAP_PORT=636 ;;
false) TLS_DISABLE='true' ;TLS_ON='false' ;;
*) TLS_DISABLE='true' ;TLS_ON='false' ;;
esac
fi
Expand Down
13 changes: 13 additions & 0 deletions scripts/fvt/fabric-ca_utils
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ tolower() {
echo "$1" | tr [:upper:] [:lower:]
}

setTLS() {
PROTO="http://"
TLSOPT=""
# if not set, default to OFF
if test -n "$FABRIC_TLS"; then
# otherwise, set TLS-related stuff
if $($FABRIC_TLS); then
PROTO="https://"
TLSOPT="--tls.certfiles $ROOTCERT"
fi
fi
}

ErrorMsg() {
local msg="$1"
local rc="$2"
Expand Down

0 comments on commit 06bb12f

Please sign in to comment.