diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-04-02 14:39:37 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-04-02 14:39:37 -0700 |
commit | 73c7c8077eb39e017e7a5a4468942a9a818af4fb (patch) | |
tree | 730582c7d9b54de3777f04166559c14e0b5dcee1 /FS/FS/part_event/Action | |
parent | 4cfac242bc51b09575ea94002ba6293850b20cef (diff) |
really don't verify certificates if asked, deb 8 style
Diffstat (limited to 'FS/FS/part_event/Action')
-rw-r--r-- | FS/FS/part_event/Action/http.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/FS/FS/part_event/Action/http.pm b/FS/FS/part_event/Action/http.pm index 673cd43..72a345d 100644 --- a/FS/FS/part_event/Action/http.pm +++ b/FS/FS/part_event/Action/http.pm @@ -4,6 +4,7 @@ use base qw( FS::part_event::Action ); use strict; use vars qw( $me ); use Data::Dumper; +use IO::Socket::SSL; use LWP::UserAgent; use HTTP::Request::Common; use Cpanel::JSON::XS; @@ -68,10 +69,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); @@ -82,7 +90,7 @@ sub do_action { ); if ( $self->option('debug') ) { - + #XXX dump raw request for debugging } my $response = $ua->request($req); |