Thread [LWP::UserAgent] Windows - get liefert "500 Can't connect to ......de:443 (Bad address)" (25 answers)
Opened by GwenDragon at 2024-06-28 11:15

GwenDragon
 2024-06-28 11:15
#196506 #196506
User since
2005-01-17
14757 Artikel
Admin1
[Homepage]
user image
Seltsames Problem auf Strawberry Perl 5.36.3.1 x64 Win 11 23H2;
alle nötigen Module installiert.

Perl 5.36.3.1 x64
libwww-perl-6.77
LWP-Protocol-https-6.14
Net-SSLeay-1.94
Net-SSLGlue-1.058
Crypt-SSLeay-0.72

Requests klappen bei meinem Server nicht mehr.
Da liefert lwp-get (aka GET) dann "500 Can't connect to gwendragon.de:443 (Bad address)"

Getestet mit:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict; 
use warnings; 
use 5.020;

use LWP::UserAgent ();
use Data::Dumper;
 
my $ua = LWP::UserAgent->new(timeout => 10);
$ua->ssl_opts( 
        SSL_ca_file => 'X:\etc\ssl\certs\cacert.pem',
        verify_hostname => 1,
);
$ua->agent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36');
 
my $response = $ua->get('https://gwendragon.de');
 
if ($response->is_success) {
    print $response->decoded_content;
}
else {
    say $response->status_line;
        say Dumper $response;
}


Andere Domains wie example.com oder perl.com klappen.

Browser klappt auch für gwendragon.de.

Abfrage mit curl:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
T:\>curl -v https://gwendragon.de/
* Host gwendragon.de:443 was resolved.
* IPv6: 2a01:4f8:130:63a2::2
* IPv4: 213.133.110.246
* Trying [2a01:4f8:130:63a2::2]:443...
* Trying 213.133.110.246:443...
* Connected to gwendragon.de (213.133.110.246) port 443
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* ALPN: server accepted http/1.1
* using HTTP/1.x
> GET / HTTP/1.1
> Host: gwendragon.de
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
< HTTP/1.1 200 OK
< Date: Fri, 28 Jun 2024 09:07:30 GMT
< Server: Apache
< Strict-Transport-Security: max-age=15768000; includeSubDomains
< Upgrade: h2
< Connection: Upgrade
< Last-Modified: Sun, 19 May 2024 11:21:32 GMT
< ETag: "f70-618ccc96cb479"
< Accept-Ranges: bytes
< Content-Length: 3952
< Cache-Control: max-age=7200
< Expires: Fri, 28 Jun 2024 11:07:30 GMT
< Vary: Accept-Encoding
< X-Content-Type-Options: nosniff
< X-Frame-Options: sameorigin
< X-Powered-By: Perl
< X-Robots-Tag: noai, noimageai, noimageindex, noarchive, noodp
< Content-Security-Policy: script-src 'self'
< Referrer-Policy: no-referrer
< Permissions-Policy: interest-cohort=()
< Content-Type: text/html; charset=utf-8
<
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
.....


Irgendeine Idee zum Lösen oder Debuggen?

//EDIT 11:34:
Sieht danach aus als würde LWP oder IO::Socket sang-und-klanglos abbrechen, wenn die IPv6 nicht erreichbar ist.

//EDIT 12:24:
Mit use IO::Socket::SSL qw/debug3/; kommt:
Code: (dl )
1
2
3
4
5
6
7
8
DEBUG: .../IO/Socket/SSL.pm:3020: new ctx 2719281884640
DEBUG: .../IO/Socket/SSL.pm:705: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:705: socket not yet connected
DEBUG: .../lib/Net/HTTPS.pm:67: local error: IO::Socket::IP configuration failed
DEBUG: .../IO/Socket/SSL.pm:3069: free ctx 2719281884640 open=2719281884640
DEBUG: .../IO/Socket/SSL.pm:3073: free ctx 2719281884640 callback
DEBUG: .../IO/Socket/SSL.pm:3080: OK free ctx 2719281884640
500 Can't connect to gwendragon.de:443 (Bad address)


Was ich nicht verstehe, dass curl und wget beide IPv6 und IPv4 probieren. Aber LWP nicht.

//EDIT: 13:05 gemeldet als Bug: https://github.com/libwww-perl/LWP-Protocol-https/...
Last edited: 2024-06-28 13:03:50 +0200 (CEST)

View full thread [LWP::UserAgent] Windows - get liefert "500 Can't connect to ......de:443 (Bad address)"