Thread https authentication error (78 answers)
Opened by a_abels at 2011-10-10 15:16

jan
 2011-10-10 17:28
#153024 #153024
User since
2003-08-04
2536 articles
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new('GET', $ARGV[0]);

my $res = $ua->simple_request($req);
if($res->code == 401 && $res->header('WWW-Authenticate') =~ m/realm="([^"]+)"/) {
print "Realm: " . $1;
}


einfach mit der URL als parameter aufrufen, das sollte dir den Realm liefern.
reply with quote

View full thread https authentication error