[freeside-commits] branch FREESIDE_3_BRANCH updated. f8b487ec9788999ed16e77ff246fa4f34f8d7af1

Ivan ivan at 420.am
Sat Apr 2 14:39:45 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  f8b487ec9788999ed16e77ff246fa4f34f8d7af1 (commit)
      from  9f913deb1cae1f9d28a531fbd4f0a2363ffe4503 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f8b487ec9788999ed16e77ff246fa4f34f8d7af1
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Apr 2 14:39:42 2016 -0700

    really don't verify certificates if asked, deb 8 style

diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index 5bba5e0..f5edc56 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 JSON;
 use URI::Escape 3.31;
@@ -736,7 +737,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,
@@ -747,7 +753,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};
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index ecf57a6..8dff768 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2360,6 +2360,7 @@ service.
 =cut
 
 use CAM::PDF;
+use IO::Socket::SSL;
 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 $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),
diff --git a/FS/FS/part_event/Action/http.pm b/FS/FS/part_event/Action/http.pm
index b8715a7..b17acb8 100644
--- 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 IO::Socket::SSL;
 use LWP::UserAgent;
 use HTTP::Request::Common;
 use JSON::XS;
@@ -60,10 +61,17 @@ sub do_action {
       ( $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);
 
diff --git a/FS/FS/part_export/http.pm b/FS/FS/part_export/http.pm
index 6cac600..42a35cb 100644
--- 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 LWP::UserAgent;
+use HTTP::Request::Common qw( POST );
+use IO::Socket::SSL;
 
 tie %options, 'Tie::IxHash',
   'method' => { label   =>'Method',
@@ -149,13 +152,12 @@ sub http {
 
   $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(
diff --git a/FS/FS/part_export/ispconfig3.pm b/FS/FS/part_export/ispconfig3.pm
index 3345b3f..9d22d19 100644
--- 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 IO::Socket::SSL;
 
 =pod
 
@@ -299,7 +300,12 @@ sub api_login {
   }
   $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';
diff --git a/FS/FS/part_export/sipwise.pm b/FS/FS/part_export/sipwise.pm
index 9559648..2585991 100644
--- 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 IO::Socket::SSL;
 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') ) {
-      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(

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Misc/Geo.pm               |   13 +++++++++++--
 FS/FS/Template_Mixin.pm         |    8 +++++++-
 FS/FS/part_event/Action/http.pm |   10 +++++++++-
 FS/FS/part_export/http.pm       |   14 ++++++++------
 FS/FS/part_export/ispconfig3.pm |    8 +++++++-
 FS/FS/part_export/sipwise.pm    |    6 +++++-
 6 files changed, 47 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list