From: Junio C Hamano Date: Mon, 21 Dec 2015 18:59:06 +0000 (-0800) Subject: Merge branch 'jk/send-email-ssl-errors' X-Git-Tag: v2.7.0-rc2~6 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7aaff08f3996eceadc98a531ef0faa8d7bae955e?ds=inline;hp=-c Merge branch 'jk/send-email-ssl-errors' Improve error reporting when SMTP TLS fails. * jk/send-email-ssl-errors: send-email: enable SSL level 1 debug output --- 7aaff08f3996eceadc98a531ef0faa8d7bae955e diff --combined git-send-email.perl index 2a3873b744,72508bed93..6caa5b563f --- a/git-send-email.perl +++ b/git-send-email.perl @@@ -46,7 -46,6 +46,7 @@@ package main sub usage { print < +git send-email --dump-aliases Composing: --from * Email From: @@@ -102,9 -101,6 +102,9 @@@ `git format-patch` ones. --force * Send even if safety checks would prevent it. + Information: + --dump-aliases * Dump configured aliases and exit. + EOT exit(1); } @@@ -184,7 -180,6 +184,7 @@@ my ($quiet, $dry_run) = (0, 0) my $format_patch; my $compose_filename; my $force = 0; +my $dump_aliases = 0; # Handle interactive edition of files. my $multiedit; @@@ -244,6 -239,7 +244,6 @@@ my %config_settings = "smtpserveroption" => \@smtp_server_options, "smtpuser" => \$smtp_authuser, "smtppass" => \$smtp_authpass, - "smtpsslcertpath" => \$smtp_ssl_cert_path, "smtpdomain" => \$smtp_domain, "smtpauth" => \$smtp_auth, "to" => \@initial_to, @@@ -263,7 -259,6 +263,7 @@@ my %config_path_settings = ( "aliasesfile" => \@alias_files, + "smtpsslcertpath" => \$smtp_ssl_cert_path, ); # Handle Uncouth Termination @@@ -296,11 -291,6 +296,11 @@@ $SIG{INT} = \&signal_handler my $help; my $rc = GetOptions("h" => \$help, + "dump-aliases" => \$dump_aliases); +usage() unless $rc; +die "--dump-aliases incompatible with other options\n" + if !$help and $dump_aliases and @ARGV; +$rc = GetOptions( "sender|from=s" => \$sender, "in-reply-to=s" => \$initial_reply_to, "subject=s" => \$initial_subject, @@@ -561,11 -551,6 +561,11 @@@ if (@alias_files and $aliasfiletype an } } +if ($dump_aliases) { + print "$_\n" for (sort keys %aliases); + exit(0); +} + # is_format_patch_arg($f) returns 0 if $f names a patch, or 1 if # $f is a revision list specification to be passed to format-patch. sub is_format_patch_arg { @@@ -1211,7 -1196,8 +1211,7 @@@ sub ssl_verify_params return (SSL_verify_mode => SSL_VERIFY_PEER(), SSL_ca_file => $smtp_ssl_cert_path); } else { - print STDERR "Not using SSL_VERIFY_PEER because the CA path does not exist.\n"; - return (SSL_verify_mode => SSL_VERIFY_NONE()); + die "CA path \"$smtp_ssl_cert_path\" does not exist"; } } @@@ -1332,6 -1318,13 +1332,13 @@@ Message-Id: $message_i require Net::SMTP::SSL; $smtp_domain ||= maildomain(); require IO::Socket::SSL; + + # Suppress "variable accessed once" warning. + { + no warnings 'once'; + $IO::Socket::SSL::DEBUG = 1; + } + # Net::SMTP::SSL->new() does not forward any SSL options IO::Socket::SSL::set_client_defaults( ssl_verify_params());