Skip to content

Commit

Permalink
Merge branch 'tr/send-email-ssl'
Browse files Browse the repository at this point in the history
SSL-related options were not passed correctly to underlying socket
layer in "git send-email".

* tr/send-email-ssl:
  send-email: set SSL options through IO::Socket::SSL::set_client_defaults
  send-email: --smtp-ssl-cert-path takes an argument
  send-email: pass Debug to Net::SMTP::SSL::new
  • Loading branch information
Junio C Hamano committed Dec 17, 2013
2 parents 7dc8a65 + 5508f3e commit 433a30d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ sub signal_handler {
"smtp-pass:s" => \$smtp_authpass,
"smtp-ssl" => sub { $smtp_encryption = 'ssl' },
"smtp-encryption=s" => \$smtp_encryption,
"smtp-ssl-cert-path" => \$smtp_ssl_cert_path,
"smtp-ssl-cert-path=s" => \$smtp_ssl_cert_path,
"smtp-debug:i" => \$debug_net_smtp,
"smtp-domain:s" => \$smtp_domain,
"identity=s" => \$identity,
Expand Down Expand Up @@ -1214,10 +1214,14 @@ sub send_message {
$smtp_server_port ||= 465; # ssmtp
require Net::SMTP::SSL;
$smtp_domain ||= maildomain();
require IO::Socket::SSL;
# Net::SMTP::SSL->new() does not forward any SSL options
IO::Socket::SSL::set_client_defaults(
ssl_verify_params());
$smtp ||= Net::SMTP::SSL->new($smtp_server,
Hello => $smtp_domain,
Port => $smtp_server_port,
ssl_verify_params());
Debug => $debug_net_smtp);
}
else {
require Net::SMTP;
Expand Down

0 comments on commit 433a30d

Please sign in to comment.