Thread (18 messages) flat view 18 messages, 4 authors, 2016-06-15

Re: [PATCH v2 1/2] send-email: squelch warning from Net::SMTP::SSL

From: brian m. carlson <hidden>
Date: 2016-06-15 22:58:09

On Sun, Jul 14, 2013 at 07:19:10PM +0530, Ramkumar Ramachandra wrote:
Torsten Bögershausen wrote:
quoted
/usr/bin/perl -MIO::Socket::SSL -e 'print "$IO::Socket::SSL::VERSION\n";'
1.22
This is ancient!  (I have 1.84).  Is it not possible to do an
ssl-verify-peer in older versions (is it exported as something else)?
The older versions don't display the warning anyway, and this series
is about squelching the warning in newer versions.  Does

  require IO::Socket::SSL qw(SSL_VERIFY_NONE SSL_VERIFY_PEER) or print
"warning: not using SSL_VERIFY_PEER due to outdated IO::Socket::SSL"
require doesn't take a list of symbols to import, and the import dies if
it fails.  You need:

require IO::Socket::SSL;
eval {
	IO::Socket::SSL->import(qw(SSL_VERIFY_NONE SSL_VERIFY_PEER));
};
if ($@) {
	warn "Not using SSL_VERIFY_PEER due to outdated IO::Socket::SSL\n";
	# Do something different here.
}

I didn't stick the require in the eval because git-send-email will fail
in this case anyway if you don't have it, since Net::SMTP::SSL requires
it.  Let me know if you want a patch for this on top of the existing two
in this series and I'll provide one.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help