Skip to content

Commit 9d60524

Browse files
johnkeepinggitster
authored andcommitted
send-email: enable SSL level 1 debug output
If a server's certificate isn't accepted by send-email, the output is: Unable to initialize SMTP properly. Check config and use --smtp-debug. but adding --smtp-debug=1 just produces the same output since we don't get as far as talking SMTP. Turning on SSL debug at level 1 gives: DEBUG: .../IO/Socket/SSL.pm:1796: SSL connect attempt failed error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed DEBUG: .../IO/Socket/SSL.pm:673: fatal SSL error: SSL connect attempt failed error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed DEBUG: .../IO/Socket/SSL.pm:1780: IO::Socket::IP configuration failed IO::Socket::SSL defines level 1 debug as "print out errors from IO::Socket::SSL and ciphers from Net::SSLeay". In fact, it aliases Net::SSLeay::trace which is defined to guarantee silence at level 0 and only emit error messages at level 1, so let's enable it by default. The modification of warnings is needed to avoid a warning about: Name "IO::Socket::SSL::DEBUG" used only once: possible typo Signed-off-by: John Keeping <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5cb2e16 commit 9d60524

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

git-send-email.perl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,13 @@ sub send_message {
13181318
require Net::SMTP::SSL;
13191319
$smtp_domain ||= maildomain();
13201320
require IO::Socket::SSL;
1321+
1322+
# Suppress "variable accessed once" warning.
1323+
{
1324+
no warnings 'once';
1325+
$IO::Socket::SSL::DEBUG = 1;
1326+
}
1327+
13211328
# Net::SMTP::SSL->new() does not forward any SSL options
13221329
IO::Socket::SSL::set_client_defaults(
13231330
ssl_verify_params());

0 commit comments

Comments
 (0)