amitsq has asked for the wisdom of the Perl Monks concerning the following question:
1) I opened up an own application pool on the IIS-Manager for strawberry perl applications. Always when a module is not known or when trying to set a path a library (see code), it totally crashes and close down the pool with the msg: HTTP Error 503. The service is unavailable. Any idea why and how to prevent that?
2)Furthermore there is a proxy installed. So when using LWP-requests, i can not get content of https pages. The following code receives the following error msgs, which is strange since the demanded module is installed!
Update: /running the script via windows shell:LWP will support https URLs if the LWP::Protocol::https module is inst +alled.
Code:can't connect to moz.com:443, the given host is not known at D:/Straw +berry_Perl/perl/vendor/lib/LWP/Pr otocol/http.pm line 46.
Did I install Strawberry Perl right? I downloaded the portable version, transfered to the server, unpacked it, executed the bash file and then just set the path to the perl file ("hello world" script works)#!d:\Strawberry_Perl\perl\bin\perl.exe use strict; use warnings; use LWP::Protocol; use LWP::UserAgent; use Mozilla::CA; use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; #use lib 'd:\\Strawberry_Perl\\perl\\vendor\\lib\\LWP\\Protocol\\'; #a +nother attempt which failed #use https; my $q= new CGI; print $q->header; my $B = new LWP::UserAgent (keep_alive => 1, agent => 'Mozilla/5.0', c +ookie_jar =>{}); my $proxy = 'http://localhost:5800'; my $Skript = "http:\/\/$ENV{SERVER_NAME}$ENV{SCRIPT_NAME}"; my $Server = "http:\/\/$ENV{SERVER_NAME}"; $B->proxy('http', $proxy); $ENV{HTTPS_PROXY} = $proxy; $ENV{'PERL_LWP_SSL_CA_PATH'} = "D:\\cert\\input\\certs"; $B->ssl_opts( SSL_ca_file => Mozilla::CA::SSL_ca_file() ); $B->ssl_opts( verify_hostname => 0 ); my $GET = $B->get('https://moz.com')->content; print $GET;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Server Issues and https-Requests
by marto (Cardinal) on Oct 23, 2017 at 12:10 UTC | |
by amitsq (Beadle) on Oct 23, 2017 at 12:22 UTC | |
by marto (Cardinal) on Oct 23, 2017 at 12:28 UTC | |
by amitsq (Beadle) on Oct 23, 2017 at 12:51 UTC | |
by marto (Cardinal) on Oct 23, 2017 at 13:03 UTC | |
|