]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 906191 - Introduce SSL for Bugzilla DB connections for MySQL
authorAlexander Tereschenko <aleksandr.v.tereschenko@linux.intel.com>
Mon, 4 Nov 2013 23:44:54 +0000 (09:44 +1000)
committerSimon Green <sgreen@redhat.com>
Mon, 4 Nov 2013 23:44:54 +0000 (09:44 +1000)
r=simon, a=glob

Bugzilla/DB/Mysql.pm
Bugzilla/Install/Localconfig.pm
template/en/default/setup/strings.txt.pl

index 908e127219bc3dd97e9762defa5c07b095516516..9c636e2b43efd753e1cd619731e5ed87f9b016ae 100644 (file)
@@ -58,6 +58,18 @@ sub new {
         mysql_auto_reconnect => 1,
     );
     
+    # MySQL SSL options
+    my ($ssl_ca_file, $ssl_ca_path, $ssl_cert, $ssl_key) =
+        @$params{qw(db_mysql_ssl_ca_file db_mysql_ssl_ca_path
+                    db_mysql_ssl_client_cert db_mysql_ssl_client_key)};
+    if ($ssl_ca_file || $ssl_ca_path || $ssl_cert || $ssl_key) {
+        $attrs{'mysql_ssl'}             = 1;
+        $attrs{'mysql_ssl_ca_file'}     = $ssl_ca_file if $ssl_ca_file;
+        $attrs{'mysql_ssl_ca_path'}     = $ssl_ca_path if $ssl_ca_path;
+        $attrs{'mysql_ssl_client_cert'} = $ssl_cert    if $ssl_cert;
+        $attrs{'mysql_ssl_client_key'}  = $ssl_key     if $ssl_key;
+    }
+
     my $self = $class->db_new({ dsn => $dsn, user => $user, 
                                 pass => $pass, attrs => \%attrs });
 
index 3fa253729816ac42af4643007405b8aeb4d91a7b..d469e13abff9943c430709894c275a9e2e3e0439 100644 (file)
@@ -79,6 +79,22 @@ use constant LOCALCONFIG_VARS => (
         name    => 'db_check',
         default => 1,
     },
+    {
+        name    => 'db_mysql_ssl_ca_file',
+        default => '',
+    },
+    {
+        name    => 'db_mysql_ssl_ca_path',
+        default => '',
+    },
+    {
+        name    => 'db_mysql_ssl_client_cert',
+        default => '',
+    },
+    {
+        name    => 'db_mysql_ssl_client_key',
+        default => '',
+    },
     {
         name    => 'index_html',
         default => 0,
index 63eb3a3fd2698afefddc2830eac4db9aa6287fde..0d5724461222b332611e9f39bb2a884dcbb55f96 100644 (file)
@@ -196,6 +196,22 @@ blank, then MySQL's compiled-in default will be used. You probably
 want that.
 END
     localconfig_db_user => "Who we connect to the database as.",
+    localconfig_db_mysql_ssl_ca_file => <<'END',
+Path to a PEM file with a list of trusted SSL CA certificates.
+The file must be readable by web server user.
+END
+    localconfig_db_mysql_ssl_ca_path => <<'END',
+Path to a directory containing trusted SSL CA certificates in PEM format.
+Directory and files inside must be readable by the web server user.
+END
+    localconfig_db_mysql_ssl_client_cert => <<'END',
+Full path to the client SSL certificate in PEM format we will present to the DB server.
+The file must be readable by web server user.
+END
+    localconfig_db_mysql_ssl_client_key => <<'END',
+Full path to the private key corresponding to the client SSL certificate.
+The file must not be password-protected and must be readable by web server user.
+END
     localconfig_diffpath => <<'END',
 For the "Difference Between Two Patches" feature to work, we need to know
 what directory the "diff" bin is in. (You only need to set this if you