From 9b1f3679f4dac3e5f8ffcf0cadae0a99b65f0fa6 Mon Sep 17 00:00:00 2001 From: Kaimi Date: Thu, 3 Mar 2016 11:41:25 +0300 Subject: [PATCH] no ssl verification in debug mode --- src/ya.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ya.pl b/src/ya.pl index 57a5001..d3970dc 100755 --- a/src/ya.pl +++ b/src/ya.pl @@ -213,7 +213,12 @@ my $ua = LWP::UserAgent->new ( agent => $opt{mobile} ? MOBILE_AGENT : AGENT, cookie_jar => new HTTP::Cookies, - timeout => TIMEOUT + timeout => TIMEOUT, + ssl_opts => + { + verify_hostname => $opt{debug} ? 0 : 1, + SSL_verify_mode => $opt{debug} ? IO::Socket::SSL->SSL_VERIFY_NONE : IO::Socket::SSL->SSL_VERIFY_PEER, + } ); my $json_decoder = JSON::PP->new->utf8->pretty->allow_nonref->allow_singlequote; my @exclude = ();