X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FMisc%2FGeo.pm;h=92490bb3b86a4cfc83923d16722c02bcc78b8833;hp=73122fa6667e98b9c450a80bc1882b3a1b4337e7;hb=820906c790f19828477eabd37218c71c2a724d86;hpb=f42c91c8d9c1f31752451f851cdf29c47f096b39 diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm index 73122fa66..92490bb3b 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};