diff --git a/gray-theme/mysql/images/ssl.gif b/gray-theme/mysql/images/ssl.gif new file mode 100644 index 000000000..c164cfea8 Binary files /dev/null and b/gray-theme/mysql/images/ssl.gif differ diff --git a/mysql/edit_ssl.cgi b/mysql/edit_ssl.cgi new file mode 100644 index 000000000..1d89b87a2 --- /dev/null +++ b/mysql/edit_ssl.cgi @@ -0,0 +1,52 @@ +#!/usr/local/bin/perl +# Show a form to setup SSL + +require './mysql-lib.pl'; +$access{'perms'} == 1 || &error($text{'cnf_ecannot'}); +&ui_print_header(undef, $text{'ssl_title'}, "", "ssl"); + +# Make sure config exists +$conf = &get_mysql_config(); +if (!$conf) { + print &text('cnf_efile', "$config{'my_cnf'}", + "../config.cgi?$module_name"),"

\n"; + &ui_print_footer("", $text{'index_return'}); + exit; + } +($mysqld) = grep { $_->{'name'} eq 'mysqld' } @$conf; +$mysqld || &error($text{'cnf_emysqld'}); +$mems = $mysqld->{'members'}; + +print &ui_form_start("save_ssl.cgi", "post"); +print &ui_table_start($text{'ssl_header'}, "width=100%", 2); + +# SSL cert file +$cert = &find_value("ssl_cert", $mems); +print &ui_table_row($text{'ssl_cert'}, + &ui_opt_textbox("cert", $cert, 60, $text{'ssl_none'})); + +# SSL key file +$key = &find_value("ssl_key", $mems); +print &ui_table_row($text{'ssl_key'}, + &ui_opt_textbox("key", $key, 60, $text{'ssl_none'})); + +# SSL CA file +$ca = &find_value("ssl_ca", $mems); +print &ui_table_row($text{'ssl_ca'}, + &ui_opt_textbox("ca", $ca, 60, $text{'ssl_none'})); + +# SSL mandatory? +$req = &find_value("require_secure_transport", $mems); +print &ui_table_row($text{'ssl_req'}, + &ui_yesno_radio("req", $req && lc($req) eq 'on')); + +print &ui_table_end(); +my @buts = ( [ "save", $text{'save'} ] ); +if (!$cert && !$key) { + push(@buts, [ "gen", $text{'ssl_gen'} ]); + } +print &ui_form_end(\@buts); + + +&ui_print_footer("", $text{'index_return'}); + diff --git a/mysql/images/ssl.gif b/mysql/images/ssl.gif new file mode 100644 index 000000000..5d08b1bf6 Binary files /dev/null and b/mysql/images/ssl.gif differ diff --git a/mysql/index.cgi b/mysql/index.cgi index 9ac8d989b..ef54072a1 100755 --- a/mysql/index.cgi +++ b/mysql/index.cgi @@ -264,7 +264,7 @@ else { 'list_tprivs.cgi', 'list_cprivs.cgi', 'edit_cnf.cgi', 'edit_manual.cgi', 'list_procs.cgi', $canvars ? ( 'list_vars.cgi' ) : ( ), - 'root_form.cgi', + 'edit_ssl.cgi', 'root_form.cgi', ); @titles = ( $text{'users_title'}, $text{'dbs_title'}, $canhosts ? ( $text{'hosts_title'} ) : ( ), @@ -272,7 +272,7 @@ else { $text{'cnf_title'}, $text{'manual_title'}, $text{'procs_title'}, $canvars ? ( $text{'vars_title'} ) : ( ), - $text{'root_title'}, + $text{'ssl_title'}, $text{'root_title'}, ); @images = ( 'images/users.gif', 'images/dbs.gif', $canhosts ? ( 'images/hosts.gif' ) : ( ), @@ -280,7 +280,7 @@ else { 'images/cnf.gif', 'images/manual.gif', 'images/procs.gif', $canvars ? ( 'images/vars.gif' ) : ( ), - 'images/root.gif', + 'images/ssl.gif', 'images/root.gif', ); if ($access{'perms'} == 2) { # Remove my.cnf and database connections icons diff --git a/mysql/lang/en b/mysql/lang/en index 7ca028672..e997f31f3 100644 --- a/mysql/lang/en +++ b/mysql/lang/en @@ -871,4 +871,13 @@ mysqlpass_estartup=Startup failed : $1 mysqlpass_echange=Password change failed : $1 mysqlpass_echange_forcepass=Force override the given password, if lost or forgotten +ssl_title=SSL Certificate +ssl_header=MySQL SSL options +ssl_cert=SSL certificate file +ssl_key=SSL key file +ssl_ca=SSL CA certificate file +ssl_req=Require clients use SSL? +ssl_none=None set +ssl_gen=Generate Certificate and Key + __norefs=1