use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common qw( GET POST );
+use IO::Socket::SSL;
use HTML::TokeParser;
use Cpanel::JSON::XS;
use URI::Escape 3.31;
return $location;
}
- my $ua = LWP::UserAgent->new( 'ssl_opts' => { 'verify_hostname'=>0 });
+ my $ua = LWP::UserAgent->new(
+ 'ssl_opts' => {
+ verify_hostname => 0,
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+ },
+ );
my $response = $ua->request( POST $url, [
'support-key' => scalar($conf->config('support-key')),
%$location,
local $@;
my $content = eval { decode_json($response->content) };
- die "Address normalization JSON error : $@\n" if $@;
+ if ( $@ ) {
+ warn $response->content;
+ die "Address normalization JSON error : $@\n";
+ }
die $content->{error}."\n"
if $content->{error};
=cut
use CAM::PDF;
+use IO::Socket::SSL;
use LWP::UserAgent;
use HTTP::Request::Common qw( POST );
use Cpanel::JSON::XS;
my $file = $self->print_pdf(%opt, 'no_addresses' => 1);
my $pages = CAM::PDF->new($file)->numPages;
- my $ua = LWP::UserAgent->new( 'ssl_opts' => { 'verify_hostname'=>0 });
+ my $ua = LWP::UserAgent->new(
+ 'ssl_opts' => {
+ verify_hostname => 0,
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+ }
+ );
my $response = $ua->request( POST $url, [
'support-key' => scalar($conf->config('support-key')),
'file' => encode_base64($file),
use strict;
use vars qw( $me );
use Data::Dumper;
+use IO::Socket::SSL;
use LWP::UserAgent;
use HTTP::Request::Common;
use Cpanel::JSON::XS;
( $field, $value );
} split(/\n/, $self->option('content') );
+ if ( $self->option('debug') ) {
+ warn "[$me] $_: ". $content{$_}. "\n" foreach keys %content;
+ }
+
my $content = encode_json( \%content );
my @lwp_opts = ();
- push @lwp_opts, 'ssl_opts'=>{ 'verify_hostname'=>0 }
+ push @lwp_opts, 'ssl_opts' => {
+ verify_hostname => 0,
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+ }
if $self->option('ssl_no_verify');
my $ua = LWP::UserAgent->new(@lwp_opts);
);
if ( $self->option('debug') ) {
-
+ #XXX dump raw request for debugging
}
my $response = $ua->request($req);
use base qw( FS::part_export );
use vars qw( %options %info );
use Tie::IxHash;
+use LWP::UserAgent;
+use HTTP::Request::Common qw( POST );
+use IO::Socket::SSL;
tie %options, 'Tie::IxHash',
'method' => { label =>'Method',
$method = lc($method);
- eval "use LWP::UserAgent;";
- die "using LWP::UserAgent: $@" if $@;
- eval "use HTTP::Request::Common;";
- die "using HTTP::Request::Common: $@" if $@;
-
my @lwp_opts = ();
- push @lwp_opts, 'ssl_opts'=>{ 'verify_hostname'=>0 } if $ssl_no_verify;
+ push @lwp_opts, 'ssl_opts' => {
+ verify_hostname => 0,
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+ }
+ if $ssl_no_verify;
my $ua = LWP::UserAgent->new(@lwp_opts);
#my $response = $ua->$method(
use Data::Dumper;
use SOAP::Lite;
+use IO::Socket::SSL;
=pod
}
$self->{'__ispconfig_session'} = undef;
$self->{'__ispconfig_client'} =
- SOAP::Lite->proxy($self->option('soap_location'), ssl_opts => [ verify_hostname => 0 ] )
+ SOAP::Lite->proxy( $self->option('soap_location'),
+ ssl_opts => [
+ verify_hostname => 0,
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+ ]
+ )
|| undef;
unless ($self->{'__ispconfig_client'}) {
$self->{'__ispconfig_error'} = 'Error creating SOAP client';
use FS::Record qw(qsearch qsearchs dbh);
use Tie::IxHash;
+use IO::Socket::SSL;
use LWP::UserAgent;
use URI;
use Cpanel::JSON::XS;
$self->{_ua} ||= do {
my @opt;
if ( $self->option('ssl_no_verify') ) {
- push @opt, ssl_opts => { verify_hostname => 0 };
+ push @opt, ssl_opts => {
+ verify_hostname => 0,
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+ };
}
my $ua = LWP::UserAgent->new(@opt);
$ua->credentials(