Perl: Cannot Access Web Service with SSL

后端 未结 8 848
礼貌的吻别
礼貌的吻别 2021-01-21 12:28

This is my first Perl script. I have installed SOAP::Lite using CPAN and it seems to have gone okay.

I\'m trying to access a simple HelloWorld .NET web service. I\'m get

8条回答
  •  忘掉有多难
    2021-01-21 12:56

    In perl v5.20.2 two things were required for me to disable ssl certificate validation:

    Before any SOAP object creation (I've putted it at top)

    $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
    

    And then modify SOAP proxy:

    my $soap = SOAP::Lite
                -> readable(1)
                -> ns($api_ns, 'tns')
                -> proxy($api_url, ssl_opts => [ SSL_verify_mode => 0 ] )
                -> on_action(sub { return "\"$action\""});
    

提交回复
热议问题