projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f913de
)
really don't verify certificates if asked, deb 8 style
author
Ivan Kohler
<ivan@freeside.biz>
Sat, 2 Apr 2016 21:39:42 +0000
(14:39 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Sat, 2 Apr 2016 21:39:42 +0000
(14:39 -0700)
FS/FS/Misc/Geo.pm
patch
|
blob
|
history
FS/FS/Template_Mixin.pm
patch
|
blob
|
history
FS/FS/part_event/Action/http.pm
patch
|
blob
|
history
FS/FS/part_export/http.pm
patch
|
blob
|
history
FS/FS/part_export/ispconfig3.pm
patch
|
blob
|
history
FS/FS/part_export/sipwise.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Misc/Geo.pm
b/FS/FS/Misc/Geo.pm
index
5bba5e0
..
f5edc56
100644
(file)
--- a/
FS/FS/Misc/Geo.pm
+++ b/
FS/FS/Misc/Geo.pm
@@
-6,6
+6,7
@@
use vars qw( $DEBUG @EXPORT_OK $conf );
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common qw( GET POST );
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common qw( GET POST );
+use IO::Socket::SSL;
use HTML::TokeParser;
use JSON;
use URI::Escape 3.31;
use HTML::TokeParser;
use JSON;
use URI::Escape 3.31;
@@
-736,7
+737,12
@@
sub standardize_freeside {
return $location;
}
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,
my $response = $ua->request( POST $url, [
'support-key' => scalar($conf->config('support-key')),
%$location,
@@
-747,7
+753,10
@@
sub standardize_freeside {
local $@;
my $content = eval { decode_json($response->content) };
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};
die $content->{error}."\n"
if $content->{error};
diff --git
a/FS/FS/Template_Mixin.pm
b/FS/FS/Template_Mixin.pm
index
ecf57a6
..
8dff768
100644
(file)
--- a/
FS/FS/Template_Mixin.pm
+++ b/
FS/FS/Template_Mixin.pm
@@
-2360,6
+2360,7
@@
service.
=cut
use CAM::PDF;
=cut
use CAM::PDF;
+use IO::Socket::SSL;
use LWP::UserAgent;
use HTTP::Request::Common qw( POST );
use JSON::XS;
use LWP::UserAgent;
use HTTP::Request::Common qw( POST );
use JSON::XS;
@@
-2400,7
+2401,12
@@
sub postal_mail_fsinc {
my $file = $self->print_pdf(%opt, 'no_addresses' => 1);
my $pages = CAM::PDF->new($file)->numPages;
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),
my $response = $ua->request( POST $url, [
'support-key' => scalar($conf->config('support-key')),
'file' => encode_base64($file),
diff --git
a/FS/FS/part_event/Action/http.pm
b/FS/FS/part_event/Action/http.pm
index
b8715a7
..
b17acb8
100644
(file)
--- a/
FS/FS/part_event/Action/http.pm
+++ b/
FS/FS/part_event/Action/http.pm
@@
-2,6
+2,7
@@
package FS::part_event::Action::http;
use strict;
use base qw( FS::part_event::Action );
use strict;
use base qw( FS::part_event::Action );
+use IO::Socket::SSL;
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON::XS;
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON::XS;
@@
-60,10
+61,17
@@
sub do_action {
( $field, $value );
} split(/\n/, $self->option('content') );
( $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 = ();
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('ssl_no_verify');
my $ua = LWP::UserAgent->new(@lwp_opts);
diff --git
a/FS/FS/part_export/http.pm
b/FS/FS/part_export/http.pm
index
6cac600
..
42a35cb
100644
(file)
--- a/
FS/FS/part_export/http.pm
+++ b/
FS/FS/part_export/http.pm
@@
-3,6
+3,9
@@
package FS::part_export::http;
use base qw( FS::part_export );
use vars qw( %options %info );
use Tie::IxHash;
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',
tie %options, 'Tie::IxHash',
'method' => { label =>'Method',
@@
-149,13
+152,12
@@
sub http {
$method = lc($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 = ();
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(
my $ua = LWP::UserAgent->new(@lwp_opts);
#my $response = $ua->$method(
diff --git
a/FS/FS/part_export/ispconfig3.pm
b/FS/FS/part_export/ispconfig3.pm
index
3345b3f
..
9d22d19
100644
(file)
--- a/
FS/FS/part_export/ispconfig3.pm
+++ b/
FS/FS/part_export/ispconfig3.pm
@@
-6,6
+6,7
@@
use base qw( FS::part_export );
use Data::Dumper;
use SOAP::Lite;
use Data::Dumper;
use SOAP::Lite;
+use IO::Socket::SSL;
=pod
=pod
@@
-299,7
+300,12
@@
sub api_login {
}
$self->{'__ispconfig_session'} = undef;
$self->{'__ispconfig_client'} =
}
$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';
|| undef;
unless ($self->{'__ispconfig_client'}) {
$self->{'__ispconfig_error'} = 'Error creating SOAP client';
diff --git
a/FS/FS/part_export/sipwise.pm
b/FS/FS/part_export/sipwise.pm
index
9559648
..
2585991
100644
(file)
--- a/
FS/FS/part_export/sipwise.pm
+++ b/
FS/FS/part_export/sipwise.pm
@@
-5,6
+5,7
@@
use strict;
use FS::Record qw(qsearch qsearchs dbh);
use Tie::IxHash;
use FS::Record qw(qsearch qsearchs dbh);
use Tie::IxHash;
+use IO::Socket::SSL;
use LWP::UserAgent;
use URI;
use JSON::XS;
use LWP::UserAgent;
use URI;
use JSON::XS;
@@
-801,7
+802,10
@@
sub ua {
$self->{_ua} ||= do {
my @opt;
if ( $self->option('ssl_no_verify') ) {
$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(
}
my $ua = LWP::UserAgent->new(@opt);
$ua->credentials(