summaryrefslogtreecommitdiff
path: root/FS/FS/Misc/Geo.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-04-02 14:39:37 -0700
committerIvan Kohler <ivan@freeside.biz>2016-04-02 14:39:37 -0700
commit73c7c8077eb39e017e7a5a4468942a9a818af4fb (patch)
tree730582c7d9b54de3777f04166559c14e0b5dcee1 /FS/FS/Misc/Geo.pm
parent4cfac242bc51b09575ea94002ba6293850b20cef (diff)
really don't verify certificates if asked, deb 8 style
Diffstat (limited to 'FS/FS/Misc/Geo.pm')
-rw-r--r--FS/FS/Misc/Geo.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index 73122fa..92490bb 100644
--- 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 IO::Socket::SSL;
use HTML::TokeParser;
use Cpanel::JSON::XS;
use URI::Escape 3.31;
@@ -655,7 +656,12 @@ sub standardize_freeside {
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,
@@ -666,7 +672,10 @@ sub standardize_freeside {
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};