App-Pod

 view release on metacpan or  search on metacpan

t/cpan/Mojo2/UserAgent.pm  view on Meta::CPAN

    if ( $proto eq 'socks' ) {
        @options{qw(socks_address socks_port)} = @options{qw(address port)};
        ( $proto, @options{qw(address port)} ) = $t->endpoint( $tx );
        my $userinfo = $tx->req->via_proxy( 0 )->proxy->userinfo;
        @options{qw(socks_user socks_pass)} = split /:/, $userinfo if $userinfo;
    }

    # TLS
    if ( $options{tls} = $proto eq 'https' ) {
        map { $options{"tls_$_"} = $self->$_ } qw(ca cert key);
        $options{tls_options}{SSL_verify_mode} = 0x00 if $self->insecure;
    }

    weaken $self;
    my $id;
    return $id = $loop->client(
        %options => sub {
            my ( $loop, $err, $stream ) = @_;

            # Connection error
            return unless $self;

t/cpan/Mojo2/UserAgent.pm  view on Meta::CPAN


=head1 ATTRIBUTES

L<Mojo::UserAgent> implements the following attributes.

=head2 ca

  my $ca = $ua->ca;
  $ua    = $ua->ca('/etc/tls/ca.crt');

Path to TLS certificate authority file used to verify the peer certificate, defaults to the value of the
C<MOJO_CA_FILE> environment variable.

  # Show certificate authorities for debugging
  IO::Socket::SSL::set_defaults(SSL_verify_callback => sub { say "Authority: $_[2]" and return $_[0] });

=head2 cert

  my $cert = $ua->cert;
  $ua      = $ua->cert('/etc/tls/client.crt');

Path to TLS certificate file, defaults to the value of the C<MOJO_CERT_FILE> environment variable.

=head2 connect_timeout



( run in 0.487 second using v1.01-cache-2.11-cpan-73692580452 )