Result:
found more than 622 distributions - search limited to the first 2001 files matching your query ( run in 0.526 )


Net-FTPSSL

 view release on metacpan or  search on metacpan

FTPSSL.pm  view on Meta::CPAN

use warnings;

# Enforce a minimum version of this module or Net::FTPSSL hangs!
# v1.08 works, v1.18 added ccc() support.
# Don't use v1.79 to v1.85 due to misleading warnings.
use IO::Socket::SSL 1.26;

use vars qw( $VERSION @EXPORT $ERRSTR );
use base ( 'Exporter', 'IO::Socket::SSL' );

# Only supports IPv4 (to also get IPv6 must use IO::Socket::IP instead. v0.20)
use IO::Socket::INET;

use Net::SSLeay::Handle;

FTPSSL.pm  view on Meta::CPAN



BEGIN {
    $VERSION = "0.42";              # The version of this module!

    my $type = "IO::Socket::SSL";
    $ipv6 = 0;                      # Assume IPv4 only ...
    $IOCLASS = "IO::Socket::INET";  # Assume IPv4 only ...
    $family_key = "Domain";         # Traditional ...
    my $msg;

    my $ioOrig = $IOCLASS;

    # Can we use IPv6 vs IPv4?  Let IO::Socket::SSL make the decision for us!
    # The logic gets real messy otherwise.
    if ( ! $type->can ("can_ipv6") ) {
       $msg = "No IPv6 support available.  You must 1st upgrade $type to support it!";

    } elsif ( $type->can_ipv6 () ) {

FTPSSL.pm  view on Meta::CPAN

     # The main purpose of this option was to allow users to specify
     # client certificates when their FTPS server requires them.
     # This hash applies to both the command & data channels.
     # Tags specified here overrided normal options if any tags
     # conflict.
     # See IO::Socket::SSL for supported options.
     %ssl_args = %{$arg->{SSL_Client_Certificate}};
     $found_ssl_args = 1;
  }

  # See IO::Socket::SSL for supported options.
  # Provides a way to directly pass needed SSL_* arguments to this module.
  # There is only one Net::FTPSSL option that starts with SSL_, so skipping it!
  for (grep { m{^SSL_} } keys %{$arg}) {
     next  if ( $_ eq "SSL_Client_Certificate" );   # The FTPSSL opt to skip!
     $ssl_args{$_} = $arg->{$_};

FTPSSL.pm  view on Meta::CPAN

  }

  # Only add if not using certificates & the caller didn't provide a value ...
  unless ( $ssl_args{SSL_use_cert} || $ssl_args{SSL_verify_mode} ) {
     # Stops the Man-In-The-Middle (MITM) security warning from start_ssl()
     # when it calls configure_SSL() in IO::Socket::SSL.
     # To plug that MITM security hole requires the use of certificates,
     # so all that's being done here is supressing the warning.  The MITM
     # security hole is still open!
     # That warning is now a fatal error in newer versions of IO::Socket::SSL.
     # warn "WARNING: Your connection is vunerable to the MITM attacks\n";
     $ssl_args{SSL_verify_mode} = Net::SSLeay::VERIFY_NONE();
  }

  # --------------------------------------------------------------------------

FTPSSL.pm  view on Meta::CPAN

  my $fixHelp      = $arg->{OverrideHELP};

  # --------------------------------------------------------------------------
  # if ( $debug && ! exists $arg->{DebugLogFile} ) {
  #   # So will write any debug comments to STDERR ...
  #   $IO::Socket::SSL::DEBUG = 3;
  # }

  # A special case used for further debugging the response!
  # This special value is undocumented in the POD on purpose!
  my $debug_extra = ($debug == 99) ? 1 : 0;

FTPSSL.pm  view on Meta::CPAN


     # ------------------------------------------------------------------------
     # The options for Reusing the Session ...
     # ------------------------------------------------------------------------
     if ( $reuseSession ) {
        $ssl_args{SSL_session_cache} = IO::Socket::SSL::Session_Cache->new (4 + $reuseSession);
        $ssl_args{SSL_session_key} = "Net-FTPSSL-${VERSION}-$$:${port}";
     }

     # _debug_print_hash (undef, "Socket call", "initialization", "?", $socket);
     # _debug_print_hash (undef, "Before start_SSL() call", "initialization", "?", \%ssl_args);

FTPSSL.pm  view on Meta::CPAN

        return _croak_or_return ($socket) unless (response ($socket) == CMD_OK);
     }

     # ------------------------------------------------------------------------
     # Now transform the clear connection into a SSL one on our end.
     # Messy since newer IO::Socket::SSL modules remove {_FTPSSL_arguments}!
     # Bug Id: 120341.
     # ------------------------------------------------------------------------
     $obj = $type->start_SSL( $socket, %ssl_args );
     unless ( $obj ) {
        unless ( exists ${*$socket}{_FTPSSL_arguments} ) {
           ${*$socket}{_FTPSSL_arguments} = \%ftpssl_args;
           _print_LOG (undef, "Restoring _FTPSSL_arguments to \$socket.\n")  if ( $debug );
        }
        return _croak_or_return ( $socket, undef,
                                  "$mode: " . IO::Socket::SSL::errstr () );
     }

     unless ( exists ${*$obj}{_FTPSSL_arguments} ) {
        ${*$obj}{_FTPSSL_arguments} = \%ftpssl_args;
        $obj->_print_LOG ("Restoring _FTPSSL_arguments to \$obj.\n")  if ( $debug );

FTPSSL.pm  view on Meta::CPAN

      # Can we use SNI?
      if ( $self->can ("can_client_sni") && $self->can_client_sni () ) {
         $ssl_opts{SSL_hostname} = $ftps_ref->{data_host};
      }

      $io = IO::Socket::SSL->start_SSL ( $ftps_ref->{data_ch}, \%ssl_opts )
               or return $self->_croak_or_return ( 0,
                                      "$mode: " . IO::Socket::SSL::errstr () );

   } elsif ( $ftps_ref->{data_prot} eq DATA_PROT_PRIVATE ) {
      $io = IO::Handle->new ();
      tie ( *$io, "Net::SSLeay::Handle", $ftps_ref->{data_ch} );

FTPSSL.pm  view on Meta::CPAN

option I<ReuseSession> or I<SSL_Client_Certificate> are also used, this option
is ignored!  By default the context is always reused on encrypted data channels
via B<SSL_reuse_ctx>.

B<SSL_*> - SSL arguments which can be applied when I<start_SSL()> is finally
called to encrypt the command channel.  See I<IO::Socket::SSL> for a list of
valid arguments.

This is an alternative to using the I<SSL_Client_Certificate> option.  But
any B<SSL_*> options provided here overrides what's provided in that hash.

FTPSSL.pm  view on Meta::CPAN

is to allow you to use client certificates when talking to your I<FTP/S> server.
Options here apply to the creation of the command channel.  And when a data
channel is needed later, it uses the B<SSL_reuse_ctx> option to reuse the
command channel's context.

See I<start_SSL()> in I<IO::Socket::SSL> for more details on this and other
options available besides those for certificates.  If an option provided via
this hash conflicts with other options we would normally use, the entries in
this hash take precedence, except for any direct B<SSL_*> options provided in
both places.

FTPSSL.pm  view on Meta::CPAN

I<fix_supported()> for more details.

This option can also be usefull when your server doesn't support the I<HELP>
command itself and you need to trigger some of the conditional logic.

B<useSSL> - This option is being depreciated in favor of L<IO::Socket::SSL>'s
B<SSL_version> option.  It's just a quick and dirty way to downgrade your
connection from B<TLS> to B<SSL> which is no longer recommended.

=back

FTPSSL.pm  view on Meta::CPAN


I<Net::FTP>

I<Net::SSLeay::Handle>

I<IO::Socket::SSL>

RFC 959 - L<http://www.rfc-editor.org/info/rfc959>

RFC 2228 - L<http://www.rfc-editor.org/info/rfc2228>

 view all matches for this distribution


Net-Fastly

 view release on metacpan or  search on metacpan

lib/Net/Fastly/Client.pm  view on Meta::CPAN

    my $res = $self->_ua->_post('/login', {}, user => $self->{user}, password => $self->{password});

    carp "DEPRECATION WARNING: Username/password authentication is deprecated and will not be available starting September 2020; please migrate to API tokens as soon as possible.";

    unless ($res->is_success) {
        die "You must have IO::Socket::SSL or Crypt::SSLeay installed in order to do SSL requests\n" if $res->code == 501 && $res->status_line =~ /Protocol scheme 'https' is not supported/;
        die "Unauthorized" unless $res->is_success;
    }
    my $content = decode_json($res->decoded_content);
    $self->{_cookie} = $res->header('set-cookie');
    return wantarray ? ($self, $content->{user}, $content->{customer}) : $self;

 view all matches for this distribution


Net-Flotum

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.05  2016-05-16 20:25:33 BRT
    - added method remove on Net::Flotum::Object::CreditCard

0.04  2016-04-05 15:27:22 BRT
    - require IO::Socket::SSL

0.03  2016-04-03 02:08:03 BRT
    - use different remote_id in t/ as cpan-testers run in parallel!
    - treat undef $res on Net::Flotum::API::ExceptionHandler (new I die with $@ without trying to read ->code)

 view all matches for this distribution


Net-FreshBooks-API

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      briefly)

0.05 2009-07-16
    - Added Crypt::SSLeay to dependencies to fix the following error:
      "501 Protocol scheme 'https' is not supported (Crypt::SSLeay or
      IO::Socket::SSL not installed)"
    - Added Path::Class to dependencies

0.04 2009-07-15
    - Fixed failing test t/007_live_test.t "Can't call method "childNodes" on an
      undefined value at /tmp/net-freshbooks-api/lib/Net/FreshBooks/API/Base.pm

 view all matches for this distribution


Net-FullAuto

 view release on metacpan or  search on metacpan

lib/Net/FullAuto/FA_Core.pm  view on Meta::CPAN

#     -l C:\strawberry\c\bin\libz.dll
#     -l C:\strawberry\c\bin\ssleay32_.dll Makefile.PL
#     -M Module::Build -M Task::Weaken -M YAML
#     -M Capture::Tiny -M ExtUtils::Depends
#     -M ExtUtils::MakeMaker -M B::Utils
#     -M Data::Dump::Streamer -M LWP -M IO::Socket::SSL
#     -M LWP::Protocol::https -M Mozilla::CA
#     -M Term::RawInput -M JSON -M Term::Menus
#     -M Win32::API -M Win32::DriveInfo -M DBD::SQLite
#     -a bin -a ChangeLog -a inc -a Module -a lib -a t
#     -a META.yml -a LICENSE -a MANIFEST -a README

 view all matches for this distribution


Net-Gemini

 view release on metacpan or  search on metacpan

lib/Net/Gemini.pm  view on Meta::CPAN

use warnings;
use Digest::SHA 'sha256_hex';
use Encode ();
use Exporter 'import';
use IO::Socket::IP;
use IO::Socket::SSL;
use Net::SSLeay;
use Parse::MIME 'parse_mime_type';

our @EXPORT_OK = qw(gemini_request);

lib/Net/Gemini.pm  view on Meta::CPAN

            PeerAddr => $obj{_host},
            PeerPort => $obj{_port},
            Proto    => 'tcp'
        ) or die $!;
        $obj{_ip} = $obj{_socket}->peerhost;
        IO::Socket::SSL->start_SSL(
            $obj{_socket},
            SSL_hostname => $obj{_host},    # SNI
            ( $param{tofu} ? ( SSL_verifycn_scheme => 'none' ) : () ),
            SSL_verify_callback => sub {
                my ( $ok, $ctx_store, $certname, $error, $cert, $depth ) = @_;

lib/Net/Gemini.pm  view on Meta::CPAN

            },
            ( exists $param{ssl} ? %{ $param{ssl} } : () ),
        ) or die $!;
        1;
    } or do {
        @obj{qw(_code _error)} = ( 0, "IO::Socket::SSL failed: $@" );
        goto BLESSING;
    };

    binmode $obj{_socket}, ':raw';

lib/Net/Gemini.pm  view on Meta::CPAN

Size of buffer to use for requests, 4096 by default. Note that a naughty
server may return data in far smaller increments than this.

=item B<ssl> => { params }

Passes the given parameters to the L<IO::Socket::SSL> constructor. These
could be used to configure e.g. the C<SSL_verify_mode> or to set a
verification callback, or to specify a custom SNI host via
C<SSL_hostname>.

C<Timeout> can be used to set a connect timeout on the socket. However,

 view all matches for this distribution


Net-Google-SafeBrowsing2

 view release on metacpan or  search on metacpan

lib/Net/Google/SafeBrowsing2.pm  view on Meta::CPAN

use Digest::HMAC_SHA1 qw(hmac_sha1 hmac_sha1_hex);
use MIME::Base64::URLSafe;
use MIME::Base64;
use String::HexConvert;
use File::Slurp;
use IO::Socket::SSL 'inet4' ;


use Exporter 'import';
our @EXPORT = qw(DATABASE_RESET MAC_ERROR MAC_KEY_ERROR INTERNAL_ERROR SERVER_ERROR NO_UPDATE NO_DATA SUCCESSFUL MALWARE PHISHING);

our $VERSION = '1.13';

BEGIN {
    IO::Socket::SSL::set_ctx_defaults(
#         verify_mode => Net::SSLeay->VERIFY_PEER(),
	SSL_verify_mode => 0,
    );
}

lib/Net/Google/SafeBrowsing2.pm  view on Meta::CPAN


=over 4

=item 1.11

Add dependency on IO::Socket::SSL.
Remove dependency on Net::IPAddress.

=item 1.10

Force IPv4 to solve bug on CentOS.

 view all matches for this distribution


Net-Google-SafeBrowsing3

 view release on metacpan or  search on metacpan

lib/Net/Google/SafeBrowsing3.pm  view on Meta::CPAN

use List::Util qw(first);
use Text::Trim;
use MIME::Base64::URLSafe;
use MIME::Base64;
use String::HexConvert;
use IO::Socket::SSL 'inet4';
use Google::ProtocolBuffers;
use Data::Dumper;

use Exporter 'import';
our @EXPORT = qw(DATABASE_RESET INTERNAL_ERROR SERVER_ERROR NO_UPDATE NO_DATA SUCCESSFUL MALWARE PHISHING UNWANTED LANDING DISTRIBUTION);


BEGIN {
    IO::Socket::SSL::set_ctx_defaults(
#         verify_mode => Net::SSLeay->VERIFY_PEER(),
			SSL_verify_mode => 0,
    );
}

 view all matches for this distribution


Net-HTTP

 view release on metacpan or  search on metacpan

lib/Net/HTTP/Methods.pm  view on Meta::CPAN



sub can_read {
    my $self = shift;
    return 1 unless defined(fileno($self));
    return 1 if $self->isa('IO::Socket::SSL') && $self->pending;
    return 1 if $self->isa('Net::SSL') && $self->can('pending') && $self->pending;

    # With no timeout, wait forever.  An explicit timeout of 0 can be
    # used to just check if the socket is readable without waiting.
    my $timeout = @_ ? shift : (${*$self}{io_socket_timeout} || undef);

 view all matches for this distribution


Net-HTTP2

 view release on metacpan or  search on metacpan

lib/Net/HTTP2/Client/Connection/IOAsync.pm  view on Meta::CPAN


use Net::HTTP2::IOSocketSSL ();

# perl -I ../p5-X-Tiny/lib -MIO::Async::Loop -MData::Dumper -MAnyEvent -I ../p5-IO-SigGuard/lib -I ../p5-Promise-ES6/lib -Ilib -MNet::HTTP2::Client::Connection::IOAsync -e'my $loop = IO::Async::Loop->new(); my $pool = Net::HTTP2::Client::Connection::...

#$IO::Socket::SSL::DEBUG = 5;
#$Net::SSLeay::trace = 8;

sub _parse_args {
    my ($class, $loop) = splice @_, 0, 2;

 view all matches for this distribution


Net-HTTPS-Any

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

        # or 'Crypt::SSLeay' => 0,
        #    'LWP' => 0,

        #failing tests is worse, Net::SSLeay appears to finally have emerged
        # as best-practice with the release of LWP::Protocol::https that uses
        # IO::Socket::SSL and therefore Net::SSLeay
        'Net::SSLeay' => 0,
    },
    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => 'Net-HTTPS-Any-*' },
);

 view all matches for this distribution


Net-HTTPS-NB

 view release on metacpan or  search on metacpan

lib/Net/HTTPS/NB.pm  view on Meta::CPAN

package Net::HTTPS::NB;

use strict;
use Net::HTTP;
use IO::Socket::SSL 0.98;
use Exporter;
use Errno qw(EWOULDBLOCK EAGAIN);
use vars qw($VERSION @ISA @EXPORT $HTTPS_ERROR);

$VERSION = 0.15;

lib/Net/HTTPS/NB.pm  view on Meta::CPAN


=back

=cut

# we only supports IO::Socket::SSL now
# use it force
$Net::HTTPS::SSL_SOCKET_CLASS = 'IO::Socket::SSL';
require Net::HTTPS;

# make aliases to IO::Socket::SSL variables and constants
use constant {
	HTTPS_WANT_READ  => SSL_WANT_READ,
	HTTPS_WANT_WRITE => SSL_WANT_WRITE,
};
*HTTPS_ERROR = \$SSL_ERROR;

 view all matches for this distribution


Net-HTTPServer

 view release on metacpan or  search on metacpan

lib/Net/HTTPServer.pm  view on Meta::CPAN

$ALLOWED{OPTIONS} = 1;
$ALLOWED{POST} = 1;
$ALLOWED{TRACE} = 1;

#------------------------------------------------------------------------------
# Do we have IO::Socket::SSL for https support?
#------------------------------------------------------------------------------
if (eval "require IO::Socket::SSL;")
{
    require IO::Socket::SSL;
    import IO::Socket::SSL;
    $SSL = 1;
}
else
{
    $SSL = 0;

lib/Net/HTTPServer.pm  view on Meta::CPAN

            {
                croak("You must specify ssl_key, ssl_cert, and ssl_ca if you want to use SSL.");
                return;
            }
            $self->_debug("INIT","Start: Create an SSL socket.");
            $self->{SOCK} = new IO::Socket::SSL(LocalPort=>$port,
                                                Proto=>"tcp",
                                                Listen=>10,
                                                Reuse=>1,
                                                SSL_key_file=>$self->{CFG}->{SSL_KEY},
                                                SSL_cert_file=>$self->{CFG}->{SSL_CERT},

lib/Net/HTTPServer.pm  view on Meta::CPAN

        {
            carp("Could not start the server: $!");
        }
        else
        {
            carp("Could not start the server: ",&IO::Socket::SSL::errstr);
        }

        return;
    }

 view all matches for this distribution


Net-Heroku

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - Using form generator instead of post_form for Mojolicious >= 3.85
        - Updated for API changes in ps and domain requests
        - Fixed add_config 'Not a HASH reference' error when nothing returned

0.09    2012-06-30 00:00:00
        - Requires IO::Socket::SSL > 1.75 for Mojolicious >= 3.0

0.08    2012-06-21 00:00:00
        - Fixed run process test
        - Added add_domain, domains, remove_domain

0.07    2012-06-06 00:00:00
        - Dropped IO::Socket::SSL requirement from 1.74 to 1.49,
            so cpanm Net::Heroku will work in Strawberry Perl 5.14.2

0.06    2012-06-06 00:00:00
        - IO::Socket::SSL dependency

0.05    2012-06-05 00:00:00
        - Changed expected text for BUILDPACK_URL config test
        - Accepts email/pass in addition to API key

 view all matches for this distribution


Net-ICAP-Client

 view release on metacpan or  search on metacpan

lib/Net/ICAP/Client.pm  view on Meta::CPAN


use strict;
use warnings;
use English qw(-no_match_vars);
use IO::Socket::INET();
use IO::Socket::SSL();
use Carp();
use URI();
use HTTP::Request();
use HTTP::Response();
use POSIX();

lib/Net/ICAP/Client.pm  view on Meta::CPAN

    my ($self) = @_;
    if ( !$self->{_socket} ) {
        my $socket_class = 'IO::Socket::INET';
        my %options;
        if ( $self->_scheme() eq 'icaps' ) {
            $socket_class = 'IO::Socket::SSL';
            %options      = %{ $self->{_ssl} };
        }
        my $socket = $socket_class->new(
            PeerAddr => $self->uri()->host(),
            PeerPort => $self->uri()->port(),

lib/Net/ICAP/Client.pm  view on Meta::CPAN

                'Failed to connect to '
              . $self->uri()->host()
              . ' on port '
              . $self->uri()->port() . q[:]
              . (
                  $socket_class eq 'IO::Socket::SSL'
                ? $socket_class->errstr()
                : $EXTENDED_OS_ERROR
              )
          );

lib/Net/ICAP/Client.pm  view on Meta::CPAN

Net::ICAP::Client requires the following non-core modules
 
  HTTP::Request
  HTTP::Response
  IO::Socket::INET
  IO::Socket::SSL
  URI

=head1 INCOMPATIBILITIES

None reported

 view all matches for this distribution


Net-ILO

 view release on metacpan or  search on metacpan

lib/Net/ILO.pm  view on Meta::CPAN

use warnings;

use Carp;
use Data::Dumper;
use English qw(-no_match_vars);
use IO::Socket::SSL;
use XML::Simple;

our $VERSION = '0.54';


lib/Net/ILO.pm  view on Meta::CPAN

    }

    my $address = $self->address or croak "Can't connect: address not set";
    my $port    = $self->port    or croak "Can't connect: port not set";

    $self->{_client} = IO::Socket::SSL->new(
        PeerAddr => "$address:$port",
    );

    if (!$self->{_client}) {
        $self->error( "Unable to establish SSL connection with $address:$port [" . IO::Socket::SSL::errstr() . "]" );
        return;
    }

    return $self->{_client};

lib/Net/ILO.pm  view on Meta::CPAN

An invalid UID state was passed to uid(). Valid states are 'on' and 'off'.

=item C<Unable to establish SSL connection with %s:%d [%s]>

An error occurred while connecting to iLO. The message in brackets is
propagated from IO::Socket::SSL, and is rarely useful.

=item C<Error transmitting command to server>

A connection was established, but something went wrong while sending the
command to the remote iLO. Try reconnecting, and ensure that your

lib/Net/ILO.pm  view on Meta::CPAN


=back

=head1 DEPENDENCIES

    IO::Socket::SSL
    XML::Simple

=head1 AUTHOR

Nicholas Lewis, C<< <nick.lewis at gmail.com> >>

 view all matches for this distribution


Net-IMAP-Client

 view release on metacpan or  search on metacpan

lib/Net/IMAP/Client.pm  view on Meta::CPAN

use warnings;

use List::Util qw( min max first );
use List::MoreUtils qw( each_array );
use IO::Socket::INET ();
use IO::Socket::SSL ();
use Socket qw( SO_KEEPALIVE );

use Net::IMAP::Client::MsgSummary ();

our $READ_BUFFER = 4096;

lib/Net/IMAP/Client.pm  view on Meta::CPAN

    my ($self) = @_;
    if (!$self->{ssl_verify_peer}
         || !$self->{ssl_ca_path}
         && !$self->{ssl_ca_file}
         && $^O ne 'linux') {
        return SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE;
    }

    my %ssl_config = ( SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_PEER );

    if ($^O eq 'linux' && !$self->{ssl_ca_path} && !$self->{ssl_ca_file}) {
        $ssl_config{SSL_ca_path} = 
			-d '/etc/ssl/certs/' ? '/etc/ssl/certs/' : '/etc/pki/tls/certs/'; 

lib/Net/IMAP/Client.pm  view on Meta::CPAN

}
sub _get_socket {
    my ($self) = @_;

    my $socket = $self->{socket};
    return $socket if (defined($socket) and ($socket->isa('IO::Socket::SSL')or $socket->isa('IO::Socket::INET')));

    $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,
                Proto    => 'tcp',
                Blocking => 1,
                $self->_get_ssl_config,
            ) or die "failed connect or ssl handshake: $!,$IO::Socket::SSL::SSL_ERROR";
    $self->{socket}->sockopt(SO_KEEPALIVE, 1);

    $self->{greeting} = $self->_socket_getline; # get the initial greeting

    $self->_starttls if ($self->{tls});         # upgrade to TLS if needed

lib/Net/IMAP/Client.pm  view on Meta::CPAN


    # request STARTTLS
    ($ok, $lines) = $self->_tell_imap('STARTTLS');
    if ($ok) {
        my @sni_args;
        push(@sni_args, SSL_hostname => $self->_get_server) if (IO::Socket::SSL->can_client_sni());
        IO::Socket::SSL->start_SSL(
            $self->{socket},
            $self->_get_ssl_config,
            @sni_args,
        ) or die $IO::Socket::SSL::SSL_ERROR;
    } else {
        die "IMAP server failed STARTTLS command"
    }

    return $self->{socket};

lib/Net/IMAP/Client.pm  view on Meta::CPAN


Password

=item - B<ssl> (BOOL, optional, default FALSE)

Pass a true value if you want to use L<IO::Socket::SSL>
You may not set both C<ssl> and C<tls> at the same time.

=item - B<tls> (BOOL, optional, default FALSE)

Pass a true value if you want to use connect without SSL and then use
C<STARTTLS> to upgrade the connection to an encrypted session using
L<IO::Socket::SSL>.  The other C<ssl_*> options also apply.

You may not set both C<ssl> and C<tls> at the same time.

=item - B<ssl_verify_peer> (BOOL, optional, default TRUE)

lib/Net/IMAP/Client.pm  view on Meta::CPAN

at least one of ssl_ca_file and ssl_ca_path is needed for ssl verify
 server

=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.

 view all matches for this distribution


Net-IMAP-Server

 view release on metacpan or  search on metacpan

t/lib/Net/IMAP/Server/Test.pm  view on Meta::CPAN

use warnings;

use Socket;
use AnyEvent;
AnyEvent::detect();
use IO::Socket::SSL;
use Time::HiRes qw();

my $PPID = $$;
sub PORT()     { 2000 + $PPID*2 }
sub SSL_PORT() { 2001 + $PPID*2 }

t/lib/Net/IMAP/Server/Test.pm  view on Meta::CPAN

sub connect {
    my $class = shift;
    my %args = (
        PeerAddr        => '127.0.0.1',
        PeerPort        => SSL_PORT,
        Class           => "IO::Socket::SSL",
        SSL_ca_file     => "certs/server-cert.pem",
        @_
    );
    my $socketclass = delete $args{Class};
    my $start = Time::HiRes::time();

t/lib/Net/IMAP/Server/Test.pm  view on Meta::CPAN

    my $socket = $class->get_socket;
    return 0 unless $socket->connected;

    my $buf;
    # We intentionally use the non-OO recv function here,
    # IO::Socket::SSL doesn't define a recv, and we want the low-level,
    # not under a layer version, anyways.
    my $waiting = recv($socket, $buf, 1, MSG_PEEK | MSG_DONTWAIT);

    # Undef if there's nothing currently waiting
    return 1 if not defined $waiting;

t/lib/Net/IMAP/Server/Test.pm  view on Meta::CPAN

    Test::More::like($socket->getline, qr/^\* OK\b/, "Got connection message");
}

sub start_tls {
    my $class = shift;
    IO::Socket::SSL->start_SSL(
        $class->get_socket,
        SSL_ca_file => "certs/server-cert.pem",
    );
}

t/lib/Net/IMAP/Server/Test.pm  view on Meta::CPAN

    local $Test::Builder::Level = $Test::Builder::Level + 1;
    my $class = shift;
    my ($msg) = @_;
    my $socket = $class->get_socket || return Test::More::fail("Not connected!");
    $class->start_tls($socket);
    Test::More::diag(IO::Socket::SSL::errstr())
        unless $socket->isa("IO::Socket::SSL");
    Test::More::ok(
        $socket->isa("IO::Socket::SSL"),
        $msg || "Negotiated TLS",
    );
}

sub send_cmd {

 view all matches for this distribution


Net-IMAP-Simple-SSL

 view release on metacpan or  search on metacpan

lib/Net/IMAP/Simple/SSL.pm  view on Meta::CPAN

use strict;

use vars qw[$VERSION];
$VERSION = (qw$Revision: 1.3 $)[1];

use IO::Socket::SSL;
use base qw[Net::IMAP::Simple];

sub _port         { 993               }
sub _sock_from    { 'IO::Socket::SSL' }

1;

__END__

lib/Net/IMAP/Simple/SSL.pm  view on Meta::CPAN

includes SSL support. The interface is identical.

=head1 SEE ALSO

L<Net::IMAP::Simple>,
L<IO::Socket::SSL>,
L<perl>.

=head1 AUTHOR

Casey West, <F<casey@geeknest.com>>.

 view all matches for this distribution


Net-IMAP-Simple

 view release on metacpan or  search on metacpan

contrib/connectalot.pl  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;
use IO::Socket::INET;
use IO::Socket::SSL;

my $ppid = $$;
END { print "[$$] ", $$==$ppid ? "ppid ":"", "exit\n" };
print "[$$] ppid started\n";

$SIG{__WARN__} = sub { print "[$$] $_[0]" };
$SIG{__DIE__}  = sub { print "[$$] $_[0]"; exit 0 };

my $class = $ENV{ca_use_ssl} ? "IO::Socket::SSL" : "IO::Socket::INET";
my $port  = $ENV{ca_use_ssl} ? 19794 : 19795;

my @pids;
for( 1 .. 5 ) {
    if( my $pid = fork ) {

 view all matches for this distribution


Net-IRC

 view release on metacpan or  search on metacpan

Connection.pm  view on Meta::CPAN

  if ($self->connected) {
    $self->quit("Changing servers");
  }
  
  if($self->ssl) {
    require IO::Socket::SSL;
    
    $self->socket(IO::Socket::SSL->new(PeerAddr  => $self->server,
                                       PeerPort  => $self->port,
                                       Proto     => "tcp",
                                       LocalAddr => $self->hostname,
                                       ));
  } else {

 view all matches for this distribution


Net-Intermapper

 view release on metacpan or  search on metacpan

lib/Net/Intermapper.pm  view on Meta::CPAN

package Net::Intermapper;
use strict;
use Moose;

# REST IO stuff here
use IO::Socket::SSL qw( SSL_VERIFY_NONE );
use LWP::UserAgent;

# Generics
use File::Path;
use URI::Escape;

lib/Net/Intermapper.pm  view on Meta::CPAN


=over 3

=item L<Moose>

=item L<IO::Socket::SSL>

=item L<LWP::UserAgent>

=item L<XML::Simple>

 view all matches for this distribution


( run in 0.526 second using v1.01-cache-2.11-cpan-1d5ca39e368 )