packaging: engine-setup -support long host fqdn (#782810)
- fixed installCA.sh to exit on error - truncate long fqdn host to avoid failure in create ca Change-Id: I7f3c5584b54afb78a28c0c22c10649d6d559e247
This commit is contained in:
@@ -138,6 +138,11 @@ CONST_FD_OPEN = 65535
|
||||
CONST_FD_LINE = "jboss %s nofile %s"
|
||||
CONST_SHMMAX=35554432
|
||||
|
||||
# This is needed for avoiding error in create_ca when supporting max cn length of 64.
|
||||
# please DONT increase this size, any value over 55 will fail the setup.
|
||||
# the truncated host-fqdn is concatenated with a random string to create a unique CN value.
|
||||
CONST_MAX_HOST_FQDN_LEN=55
|
||||
|
||||
#text colors
|
||||
RED="\033[0;31m"
|
||||
GREEN="\033[92m"
|
||||
|
||||
@@ -779,7 +779,12 @@ def _createCA():
|
||||
|
||||
# Add random string to certificate CN field
|
||||
randInt = random.randint(10000,99999)
|
||||
uniqueCN = conf["HOST_FQDN"] + "." + str(randInt)
|
||||
|
||||
# Truncating host fqdn to max allowed in certificate CN field
|
||||
truncatedFqdn = conf["HOST_FQDN"][0:basedefs.CONST_MAX_HOST_FQDN_LEN]
|
||||
logging.debug("truncated HOST_FQDN '%s' to '%s'. sized reduced to %d.."%(conf["HOST_FQDN"],truncatedFqdn,len(truncatedFqdn)))
|
||||
uniqueCN = truncatedFqdn + "." + str(randInt)
|
||||
logging.debug("using unique CN: '%s' for CA certificate"%uniqueCN)
|
||||
|
||||
# Create the CA
|
||||
cmd = [os.path.join(basedefs.DIR_OVIRT_PKI, "installCA.sh"), conf["HOST_FQDN"],
|
||||
|
||||
Reference in New Issue
Block a user