Problem using HTML::Form with LWP & SSL

Problem using HTML::Form with LWP & SSL

am 29.09.2004 21:47:36 von sborruso

Greetings,

Having a problem parsing a returned form now that SSL has been enabled at
the target

My application would connect to eBay specifying the page to "change an
auction item description".
I would then catch the returned login page, fill in the userid/password an=
d
would then be directed
to the page to start change item description process (Enter Item Number
page form).

Since eBay has enabled SSL for signing in (couple days ago) my app breaks
when trying to parse for the=20
input area on the Add Description form using HTML::Form

I changed the first form parse to specify an https url base and do receive=

the login page fine and am able to parse/update/submit=20
the userid/password using HTML::Form The Add Description page comes bac=
k
ok but the last HTML::Form parse below fails
when I issue that against the returned html I dumped some headers on th=
is
received page that indicate SSL is in effect but=20
if I save the page and bring it up in a browser the properties of the page=

indicate it's straight http

Not sure how to further debug the HTML::Form that's failing below

Here's the SSL header info -=20
=20
head1 - AES256-SHA=20
head2 - /C=3DUS/ST=3DCalifornia/L=3DSan Jose/O=3DeBay Inc/OU=3DSite
Operations/CN=3Dsigninebaycom=20
head3 - /C=3DUS/O=3DRSA Data Security, Inc/OU=3DSecure Server Certifica=
tion
Authority=20
status is 200 OK

I learned that I needed to have the correct Perl mods for LWP to handle SS=
L
installed on my server and made sure=20
they were there Crypt::SSLeay and Net::SSLeay were already present and =
I
had IO::Socket::SSL
added This is all running on RHEL 3.

Any assistance/guidance/pointers are most appreciated

Thanks,
Steve

Snipit that talks to eBay for Add to Item Description -=20

#----------------------------------------------------------- --------------=
--
---------------------
# Try to "Add to Item Description" to get the login page (this will return=

the Login page first)
#----------------------------------------------------------- --------------=
--
---------------------
my $ua =3D LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new(file =3D> "$CustCookieFile", autosave =3D=
>
1));

$sign_in_page=3D'http://cgi5ebaycom/ws/eBayISAPIdll ?AddToItemDesc=
ription&fr
omryilanding=3D2';

my $r =3D $ua->request(HTTP::Request->new(GET =3D> "$sign_in_page"));
$html =3D $r->content;

@forms =3D HTML::Form->parse($html,'https://signinebaycom');

$name=3D 'userid';
$form_password =3D 'pass';

#print "This should be the login page -
$html
";
#---------------------------------------------------------
# Fill in the Userid and Password fields on the login Page=20
#---------------------------------------------------------
$input_userid =3D $forms[1]->find_input($name);
$input_pass =3D $forms[1]->find_input($form_password);
$input_userid -> value($userid);
$input_pass -> value($ebaypassword);

#------------------------------------------------
# Click the login Submit button on the Login Page=20
#------------------------------------------------
for my $find_sub ($forms[1]->inputs) {
next unless $find_sub ->type eq 'submit';
$keep_find_sub =3D $find_sub;=20
}
my $req2 =3D $keep_find_sub->click($forms[1]);
my $uri2 =3D new $HTTP::URI_CLASS($req2->uri);
$req2->uri($uri2);
my $r2 =3D $ua->simple_request($req2);
while ($r2->is_redirect) {
my $u2 =3D $r2->header('location') or die "missing location: ",
$r2->as_string;
# print "redirecting to $u2\n";
$r2 =3D $ua->simple_request(GET $u2);
}

#$headers1 =3D $r2->header('Client-SSL-Cipher');
#$headers2 =3D $r2->header('Client-SSL-Cert-Subject');
#$headers3 =3D $r2->header('Client-SSL-Cert-Issuer');
#$status =3D $r2->status_line;
#print "head1 $headers1
head2 $headers2
head3 $headers3
";
#print "status is $status";
#my $retry_html =3D $r2->content;
#print "$retry_html";

my $itemnum_page_html =3D $r2->content;

print "This should be the enter Iten Num page $itemnum_page_html ";
print 'this is directly after printing the page';

#----------------------------------------------------------- --------------=
--
---------------------
# We should now be on the "Enter an Item number page"
#----------------------------------------------------------- --------------=
--
---------------------
$itemnum_name =3D 'ItemNo';
$Got_To_Itemnum_Page =3D 'Add To Description';
$itemnum_page_html =3D~ s/\n/ /g; # Get rid of the linefeeds
$itemnum_page_html =3D~ s/\s+/ /g; # Compress spaces/tabs

#----------------------------------------------------------- --------------=
--
---------------------
# Find the Item Num input area and the submit button
#----------------------------------------------------------- --------------=
--
---------------------
print 'before parsing the form
';

@itemnum_forms =3D
HTML::Form->parse($itemnum_page_html,'http://cgi5ebayc om/ws/') ;
=20
print 'after parsing the form
'; # Never get here

------------------------------------------------------------ --------
mail2web - Check your email from the web at
http://mail2webcom/