You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2017/08/10 16:05:12 UTC

[31/43] incubator-trafficcontrol git commit: Fix TO Golang Postinstall to keep existing port

Fix TO Golang Postinstall to keep existing port


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/84a4b129
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/84a4b129
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/84a4b129

Branch: refs/heads/master
Commit: 84a4b12963d5c6642bc406516d18baf1c09503fa
Parents: 9987fb9
Author: Robert Butts <ro...@gmail.com>
Authored: Sun Aug 6 12:21:24 2017 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Thu Aug 10 09:46:03 2017 -0600

----------------------------------------------------------------------
 traffic_ops/install/bin/generateCert    | 12 ++++++++++--
 traffic_ops/install/lib/GenerateCert.pm | 12 ++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/84a4b129/traffic_ops/install/bin/generateCert
----------------------------------------------------------------------
diff --git a/traffic_ops/install/bin/generateCert b/traffic_ops/install/bin/generateCert
index faf0b36..713288f 100755
--- a/traffic_ops/install/bin/generateCert
+++ b/traffic_ops/install/bin/generateCert
@@ -46,11 +46,19 @@ EOF
 sub writeCdn_conf {
 	my $cdn_conf = shift;
 
-	# listen param to be inserted
-	my $listen_str = "https://[::]:443?cert=${cert}&key=${key}&ca=${ca}&verify=0x00&ciphers=AES128-GCM-SHA256:HIGH:!RC4:!MD5:!aNULL:!EDH:!ED";
 
 	# load as perl hash to find string to be replaced
 	my $cdnh = do $cdn_conf;
+
+	# get existing port, if any
+	my $listen = $cdnh->{hypnotoad}{listen}[0];
+	my ($port) = $listen =~ /:(\d+)/;
+	if (!defined($port)) {
+			$port = 60443;
+	}
+	# listen param to be inserted
+	my $listen_str = "https://[::]:${port}?cert=${cert}&key=${key}&ca=${ca}&verify=0x00&ciphers=AES128-GCM-SHA256:HIGH:!RC4:!MD5:!aNULL:!EDH:!ED";
+
 	if ( exists $cdnh->{hypnotoad} ) {
 		$cdnh->{hypnotoad}{listen} = [$listen_str];
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/84a4b129/traffic_ops/install/lib/GenerateCert.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/install/lib/GenerateCert.pm b/traffic_ops/install/lib/GenerateCert.pm
index 8c2c888..1752aa8 100644
--- a/traffic_ops/install/lib/GenerateCert.pm
+++ b/traffic_ops/install/lib/GenerateCert.pm
@@ -43,11 +43,19 @@ EOF
 sub writeCdn_conf {
     my $cdn_conf = shift;
 
-    # listen param to be inserted
-    my $listen_str = "https://[::]:443?cert=${cert}&key=${key}&ca=${ca}&verify=0x00&ciphers=AES128-GCM-SHA256:HIGH:!RC4:!MD5:!aNULL:!EDH:!ED";
 
     # load as perl hash to find string to be replaced
     my $cdnh = do $cdn_conf;
+
+    # get existing port, if any
+    my $listen = $cdnh->{hypnotoad}{listen}[0];
+    my ($port) = $listen =~ /:(\d+)/;
+    if (!defined($port)) {
+        $port = 60443;
+    }
+    # listen param to be inserted
+    my $listen_str = "https://[::]:${port}?cert=${cert}&key=${key}&ca=${ca}&verify=0x00&ciphers=AES128-GCM-SHA256:HIGH:!RC4:!MD5:!aNULL:!EDH:!ED";
+
     if ( exists $cdnh->{hypnotoad} ) {
         $cdnh->{hypnotoad}{listen} = [$listen_str];
     }