Re: LWP hangs forever with get
[email protected] (Daniel de Oliveira Mantovani) Wed, 21 May 2014 09:12:58 -0300
| Newsgroups | perl.libwww |
|---|---|
| Message-ID | <CAEmYuOvnyNcLki6vNdD9nWTJHg5=G+FGHGcDsSS_Q20S0MosPg@mail.gmail.com> |
Hi, Jesper. It's happen because it should happen. You don't have the
error because you are not handle error.
This happen because LWP has a timeout to wait the server response,
after this timeout it will return a timeout error. In your case, you
don't handle the error the only stuff you get is nothing.
This URL "https://www.butler.edu/boa/default.aspx" has two problems:
1 - The certificate authority is not trusted
2 - Never (i.e until timeout) response to the client
If you are inside an intranet and you can access this site from your
browser and you know ins't cache. Start handle with error, and show it
to us.
To avoid "certificate authority not trusted" you can use:
BEGIN {
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} =3D 0;
}
Lab:~ danielmantovani$ wget "https://www.butler.edu/boa/default.aspx"
--2014-05-21 09:04:08-- https://www.butler.edu/boa/default.aspx
Resolving www.butler.edu (www.butler.edu)... 159.242.130.240
Connecting to www.butler.edu (www.butler.edu)|159.242.130.240|:443... conne=
cted.
ERROR: The certificate of =E2=80=98www.butler.edu=E2=80=99 is not trusted.
ERROR: The certificate of =E2=80=98www.butler.edu=E2=80=99 hasn't got a kno=
wn issuer.
Lab:~ danielmantovani$ wget "https://www.butler.edu/boa/default.aspx"
--no-check-certificate
--2014-05-21 09:04:39-- https://www.butler.edu/boa/default.aspx
Resolving www.butler.edu (www.butler.edu)... 159.242.130.240
Connecting to www.butler.edu (www.butler.edu)|159.242.130.240|:443... conne=
cted.
WARNING: The certificate of =E2=80=98www.butler.edu=E2=80=99 is not trusted=
.
WARNING: The certificate of =E2=80=98www.butler.edu=E2=80=99 hasn't got a k=
nown issuer.
HTTP request sent, awaiting response... Read error (Success.) in headers.
Retrying.
On 21 May 2014 05:37, Jesper Persson <[email protected]> wrote:
> ---------------------
> use LWP::Simple;
> $contents =3D get("https://www.butler.edu/boa/default.aspx");
> ---------------------
> the perl process never returns.
>
> lwp version: "VERSION: 6.06"
>
> Summary of my perl5 (revision 5 version 18 subversion 2) configuration:
> Platform:
> osname=3DMSWin32, osvers=3D6.2, archname=3DMSWin32-x64-multi-thread
> uname=3D'Win32 strawberry-perl 5.18.2.1 #1 Tue Jan 7 22:32:35 2014 x=
64'
>
> Best Regards
> Jesper Persson
--=20
-dom
--
Daniel de Oliveira Mantovani
Business Analytic Specialist
Perl Evangelist /Astrophysics hobbyist.
+55 11 9 8538-9897
XOXO