From fc0c5f312a0aaa0dd3803786a6c20489d90d0321 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Wed, 11 Feb 2009 08:25:18 +0100 Subject: [PATCH] add configfile option to specify port and enable SSL SSL doesn't work correctly yet, dies somewhere in Crypt::SSLeay --- README.txt | 2 +- rsbs2.pl | 13 ++++++++++++- rsbs2rc | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index 8677475..46d1217 100644 --- a/README.txt +++ b/README.txt @@ -34,7 +34,7 @@ Linux notes: If you don't do this, the bootup process will take a long time but finally succeed. * Install required perl packages: - apt-get install libwww-perl libxml-simple-perl + apt-get install libwww-perl libxml-simple-perl libcrypt-ssleay-perl Pinout: +---------------+---------------+--------------------------------------+---+- diff --git a/rsbs2.pl b/rsbs2.pl index cb0534a..fcd433e 100755 --- a/rsbs2.pl +++ b/rsbs2.pl @@ -689,7 +689,18 @@ my $host = ${$Config{$hostalias}}{"host"}; $poweronms = ${$Config{$hostalias}}{"poweronms"} if (defined(${$Config{$hostalias}}{"poweronms"})); $poweroffms = ${$Config{$hostalias}}{"poweroffms"} if (defined(${$Config{$hostalias}}{"poweroffms"})); -$url = "http://${host}"; +my $ssl = ${$Config{$hostalias}}{"ssl"}; +my $port = ${$Config{$hostalias}}{"port"}; + +if (defined($ssl) && (lc($ssl) eq 'yes')) { + $ENV{HTTPS_DEBUG} = 1; + $ENV{HTTPS_VERSION} = 3; + $port = 443 if (!defined($port)); + $url = "https://${host}:${port}"; +} else { + $port = 80 if (!defined($port)); + $url = "http://${host}:${port}"; +} if ($gui) { spawn_gui($url); diff --git a/rsbs2rc b/rsbs2rc index 5e0cf93..86bd1cc 100644 --- a/rsbs2rc +++ b/rsbs2rc @@ -4,5 +4,7 @@ host=192.168.50.6 user=admin pass=admin +;port=80 +;ssl=no ;poweronms=200 ;poweroffms=5000 -- 2.39.2