Commit 99172706 authored by Guillaume Huard's avatar Guillaume Huard
Browse files

More thorough disabling of SSL verifications

parent c520109c
......@@ -4,7 +4,6 @@ use LWP::UserAgent;
use File::Slurp;
use Getopt::Long qw(:config bundling);
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $url = 'https://moodle.caseine.org';
my $debug=0;
my $json=0;
......@@ -121,10 +120,12 @@ my $content = [
wsfunction => "mod_vpl_$command"
];
push @{$content}, "moodlewsrestformat", "json" if $json;
failure "Unknown command" unless exists($handlers{$command});
failure "Unknown command $command" unless exists($handlers{$command});
&{$handlers{$command}}($content, @ARGV);
my $ua = LWP::UserAgent->new( agent => 'Secret');
$ua->ssl_opts(verify_hostname => 0);
$ua->ssl_opts(SSL_verify_mode => 0x00);
my $res = $ua->post( $url,
Content_Type => 'form-data',
Content => $content
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment