FS#36506 - [git] git send-email broken after update

Attached to Project: Arch Linux
Opened by Alexandre Courbot (Gnurou) - Monday, 12 August 2013, 14:16 GMT
Last edited by Dan McGee (toofishes) - Friday, 30 August 2013, 14:45 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
git send-email suddently stopped working. No change were done to configuration. Only the following cryptic message appears:

Example reproduction:
$ git send-email --to=test@test.com 000*.patch
....
Send this email? ([y]es|[n]o|[q]uit|[a]ll): a
Can't call method "message" on an undefined value at /usr/lib/git-core/git-send-email line 1215.

Additional info:
Packages version:
git: 1.8.3.4-1
perl-net-smtp-ssl: 1.8.3.4-1
perl-authen-sasl: 2.16-1

Configuration:
[sendemail]
smtpencryption = tls
smtpserver = smtp.server.org
smtpuser = user
smtpserverport = 587
confirm = always
chainreplyto = false

Additional information:
Information about this is sparse on the net, but a similar bug has been filled for Debian:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718976

Contrary to the Debian bug though, downgrading did not help with the issue on Arch.
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 30 August 2013, 14:45 GMT
Reason for closing:  Not a bug
Comment by Eivind Uggedal (uggedal) - Monday, 12 August 2013, 20:46 GMT
TLDR: pacman -S ca-certificates

The upgrade of perl-io-socket-ssl from 1.94 to 1.953[1] is the reason for this.

perl-io-socket-ssl 1.95 changed the default of ssl_verify_mode from SSL_VERIFY_NONE to SSL_VERIFY_PEER[2].

The fix is to add ca-certificates as a dependency to git or perl-io-socket-ssl directly.

The other dependants of perl-io-socket-ssl could be checked for wether they override the default of ssl_verify_mode to determine where to put the dependency:

[1]: https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/perl-io-socket-ssl&id=18d3ef50af03b23dd5535763be5c4be5e0aea042
[2]: https://github.com/noxxi/p5-io-socket-ssl/commit/ad0d04f177acd385165105ed2b3a00064caa5dad
Comment by Dave Reisner (falconindy) - Monday, 12 August 2013, 20:55 GMT
> The fix is to add ca-certificates as a dependency to git or perl-io-socket-ssl directly.
git depends on curl, curl depends on ca-certificates.
Comment by Eivind Uggedal (uggedal) - Monday, 12 August 2013, 21:10 GMT
Right. I hit a bug in Alpine Linux today with the exact same error message after they upgraded perl-io-socket-ssl from 1.94 to 1.953. The resolution there was to install ca-certificates.

I can not reproduce the bug on my Arch Linux box with the exact same versions as the OP (seems he typoed the perl-net-smtp-ssl version though).
Comment by Alexandre Courbot (Gnurou) - Monday, 12 August 2013, 23:32 GMT
Sorry, perl-net-smtp-ssl version is 1.01-3, paste error.

ca-certificate is indeed present on my system. Downgrading perl-io-socket-ssl to 1.94 solves this. IIUC, the fix would be for git to explicitly specify SSL_VERIFY_NONE when establishing the SMTP connection? (that and better error reporting)
Comment by Dan McGee (toofishes) - Saturday, 24 August 2013, 16:41 GMT
This needs to be taken upstream, I'm not going to patch or fix it specifically for Arch Linux. Has this been done?
Comment by Dave Reisner (falconindy) - Saturday, 24 August 2013, 16:50 GMT
> the fix would be for git to explicitly specify SSL_VERIFY_NONE when establishing the SMTP connection
That's not a fix, that's a hack which disables SSL verification which greatly diminishes the point of using SSL...

> This needs to be taken upstream
To the perl-io-socket-ssl people, no less...
Comment by Alexandre Courbot (Gnurou) - Sunday, 25 August 2013, 10:43 GMT
Allright, let's bring this to git/perl-io-socket-ssl people and see who can fix it.
Comment by Alexandre Courbot (Gnurou) - Thursday, 29 August 2013, 09:58 GMT
git 1.8.4 also breaks with a similar error even if perl-io-socket-ssl is 1.94. Better not upgrade from 1.8.3 for now.
Comment by Alexandre Courbot (Gnurou) - Friday, 30 August 2013, 02:24 GMT
Found a workaround from git 1.8.4: just add --smtp-ssl-cert-path (without any argument) to the git send-email command line, or set the sendemail.smtpsslcertpath config variable to an empty string to disable SSL certificate verification. Using this there is no need to downgrade anything.

The problem likely only happens with mail servers that don't have valid certification (provided ca-certificates is installed). Thus that's where the bug seems to be, that's not an issue with git or perl-io-socket-ssl. This issue can probably be closed, thanks for the help!
Comment by Dan McGee (toofishes) - Friday, 30 August 2013, 14:45 GMT
Thanks for looking into it and actually posting what you found as well a solution here, it should help anyone in the future that has the same problem.

Loading...