diff options
author | jocuri%softhome.net <> | 2005-01-16 22:09:56 +0100 |
---|---|---|
committer | jocuri%softhome.net <> | 2005-01-16 22:09:56 +0100 |
commit | 3b4174f1273818d1a01080ed8a97715c38e74e37 (patch) | |
tree | f7e9fe0ae0bae21fa95d877ffeca364ad97eb3e5 /defparams.pl | |
parent | b36c4ef40718e469d5924721cee4ef15b1a1bf64 (diff) | |
download | bugzilla-3b4174f1273818d1a01080ed8a97715c38e74e37.tar.gz bugzilla-3b4174f1273818d1a01080ed8a97715c38e74e37.tar.xz |
Patch for bug 260682: Support redirecting to HTTPS always or for authenticated sessions only; patch by Byron Jones (glob) <bugzilla@glob.com.au>, r=vladd, a=myk.
Diffstat (limited to 'defparams.pl')
-rw-r--r-- | defparams.pl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/defparams.pl b/defparams.pl index 4fdf52a60..d97a09085 100644 --- a/defparams.pl +++ b/defparams.pl @@ -50,12 +50,36 @@ use strict; use vars qw(@param_list); use File::Spec; # for find_languages +use Socket; use Bugzilla::Config qw(:DEFAULT $templatedir $webdotdir); +use Bugzilla::Util; # Checking functions for the various values # Some generic checking functions are included in Bugzilla::Config +sub check_sslbase { + my $url = shift; + if ($url ne '') { + if ($url !~ m#^https://([^/]+).*/$#) { + return "must be a legal URL, that starts with https and ends with a slash."; + } + my $host = $1; + if ($host =~ /:\d+$/) { + return "must not contain a port."; + } + local *SOCK; + my $proto = getprotobyname('tcp'); + socket(SOCK, PF_INET, SOCK_STREAM, $proto); + my $sin = sockaddr_in(443, inet_aton($host)); + if (!connect(SOCK, $sin)) { + return "Failed to connect to " . html_quote($host) . + ":443, unable to enable SSL."; + } + } + return ""; +} + sub check_priority { my ($value) = (@_); &::GetVersionTable(); @@ -293,6 +317,24 @@ sub find_languages { }, { + name => 'sslbase', + desc => 'The URL that is the common initial leading part of all HTTPS ' . + '(SSL) Bugzilla URLs.', + type => 't', + default => '', + checker => \&check_sslbase + }, + + { + name => 'ssl', + desc => 'Controls when Bugzilla should enforce sessions to use HTTPS by ' . + 'using <tt>sslbase</tt>.', + type => 's', + choices => ['never', 'authenticated sessions', 'always'], + default => 'never' + }, + + { name => 'languages' , desc => 'A comma-separated list of RFC 1766 language tags. These ' . 'identify the languages in which you wish Bugzilla output ' . |