Subject: | add 'ssl_options' argument |
was useful for me to modify the ssl_verify_mode of IO::Socket::SSL.
Patch also available at
https://github.com/yanick/Net-IMAP-Client
Subject: | 0001-add-ssl_options-argument-for-new.patch |
From 4781364b829fa309a7bf1ab91d798db54253b95a Mon Sep 17 00:00:00 2001
From: Yanick Champoux <yanick@babyl.dyndns.org>
Date: Sat, 30 Mar 2013 12:18:11 -0400
Subject: [PATCH] add 'ssl_options' argument for new()
in my case, it was necessary to convince
IO::Socket::SSL to have its SSL_verify_mode
set to NONE.
---
lib/Net/IMAP/Client.pm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/Net/IMAP/Client.pm b/lib/Net/IMAP/Client.pm
index dc2f2e8..b9669a7 100644
--- a/lib/Net/IMAP/Client.pm
+++ b/lib/Net/IMAP/Client.pm
@@ -26,6 +26,7 @@ my %DEFAULT_ARGS = (
ssl => 0,
socket => undef,
_cmd_id => 0,
+ ssl_options => {},
);
sub new {
@@ -622,6 +623,7 @@ sub _get_server {
sub _get_socket {
my ($self) = @_;
my $socket = $self->{socket} ||= ($self->{ssl} ? 'IO::Socket::SSL' : 'IO::Socket::INET')->new(
+ ( ( %{$self->{ssl_options}} ) x !!$self->{ssl} ),
PeerAddr => $self->_get_server,
PeerPort => $self->_get_port,
Timeout => $self->_get_timeout,
@@ -1171,6 +1173,10 @@ Password
Pass a true value if you want to use IO::Socket::SSL
+=item - B<ssl_options> (HASHREF, optional)
+
+Optional arguments to be passed to the L<IO::Socket::SSL> object.
+
=item - B<uid_mode> (BOOL, optional, default TRUE)
Whether to use UID command (see RFC3501). Recommended.
--
1.7.9.5