Skip to content

Commit

Permalink
Add appliance hostname to SAN for self signed certs (#1378) (#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtchin authored Feb 1, 2018
1 parent d752303 commit 132fb13
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
10 changes: 8 additions & 2 deletions installer/build/scripts/admiral/configure_admiral.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ function genCert {
-out $csr -subj \
"/C=US/ST=California/L=Palo Alto/O=VMware/OU=Containers on vSphere/CN=$hostname"

echo "Add subjectAltName = IP: $ip_address to certificate"
echo subjectAltName = IP:"$ip_address" > $ext
if [ -n "$hostname" ] && [ "$hostname" != "$ip_address" ]; then
san="subjectAltName = DNS:$hostname,IP:$ip_address"
else
san="subjectAltName = IP:$ip_address"
fi
echo "Add subjectAltName $san to certificate"
echo "$san" > $ext

openssl x509 -req -days 1095 -in $csr -CA $ca_cert -CAkey $ca_key -CAcreateserial -extfile $ext -out $cert

echo "Creating certificate chain for $cert"
Expand Down
10 changes: 8 additions & 2 deletions installer/build/scripts/fileserver/configure_fileserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ function genCert {
-out $csr -subj \
"/C=US/ST=California/L=Palo Alto/O=VMware/OU=Containers on vSphere/CN=$hostname"

echo "Add subjectAltName = IP: $ip_address to certificate"
echo subjectAltName = IP:$ip_address > $ext
if [ -n "$hostname" ] && [ "$hostname" != "$ip_address" ]; then
san="subjectAltName = DNS:$hostname,IP:$ip_address"
else
san="subjectAltName = IP:$ip_address"
fi
echo "Add subjectAltName $san to certificate"
echo "$san" > $ext

openssl x509 -req -days 1095 -in $csr -CA $ca_cert -CAkey $ca_key -CAcreateserial -extfile $ext -out $cert

echo "self-signed" > $flag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ function genCert {
-out $csr -subj \
"/C=US/ST=California/L=Palo Alto/O=VMware/OU=Containers on vSphere/CN=$hostname"

echo "Add subjectAltName = IP: $ip_address to certificate"
echo subjectAltName = IP:"$ip_address" > $ext
if [ -n "$hostname" ] && [ "$hostname" != "$ip_address" ]; then
san="subjectAltName = DNS:$hostname,IP:$ip_address"
else
san="subjectAltName = IP:$ip_address"
fi
echo "Add subjectAltName $san to certificate"
echo "$san" > $ext

openssl x509 -req -days 1095 -in $csr -CA $ca_cert -CAkey $ca_key -CAcreateserial -extfile $ext -out $cert

echo "Creating certificate chain for $cert"
Expand Down

0 comments on commit 132fb13

Please sign in to comment.