Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

128bit SSL and Perl - PaulTEG? 4

Status
Not open for further replies.

strantheman

Programmer
Joined
Mar 12, 2001
Messages
333
Location
US
Im new to Perl and this forum, but not Tek-Tips. I appreciate any help you guys can offer here, and will be checking back often. Im trying to get Perl to login to a HTTPS site and retrieve a CSV file. I have been unsuccessful because the site requires 128bit encryption and is refusing my attempt to login. Yes, all of my login info is accurate.

Here's exactly how im setup: Downloaded ActivePerl and installed on my dev server. [Win2k running IIS]. Ran PPM and installed Found a SSL solution at( and followed those steps. Started a file called spider.pl and began my logic.

1) $mech is my new object.
2) I set the agent_alias to 'Windows IE 6' so that the header of the request makes it look like IE 6 is hitting the server. (ive also set these parameters using an array but this works just as well)
3) $response is my attempt to read the login form page using $mech->get($url)
4) $mech->form_name("form") to choose the only form on the page
5) $mech->field(password=>"xxxxxxx") to fill in the text input named password with the value xxxxxxxx
6) Print $mech->response->status_line at the end to see what the response was.
7) And finally ouput the HTML of the following page with $mech->response->content.

If the form submit worked, I should see the first page of a framed website... I assume Id see the index file and the frame tags, not content from one of the frames. However, I get the site's generic "password not accepted" error page. The page is ambiguous and gives me no clue as to what went wrong, but after extensive testing on other sites and on my own web forms, Ive realized that my encryption standard is not compatible.

I have added the following SSL module ( to my Perl install. It allowed me to at least read HTTPS pages, like the login form. Without this I couldn't even read the form page. However, it doesn't seem to be enough to grant me the secure connection I need.

Any help here would be hot. Im totally lost. How do I get Perl to use the SSL 3.0 standard?

Code:
# spider
use strict;
$|++;
use LWP 5.64;
use [URL unfurl="true"]WWW::Mechanize;[/URL]
my $mech = [URL unfurl="true"]WWW::Mechanize->new();[/URL]
$mech->agent_alias( 'Windows IE 6' );


##START
my $url = '[URL unfurl="true"]https://www.whatever.com';[/URL]
my $response = $mech->get($url);

##FORM
$mech->form_name( "form" );
	$mech->field( password => "pass" );
	$mech->submit();
$mech->success or die "post failed: ", $mech->response->status_line;
my $html = $mech->response->content;
print "$html";

ty
 
As for no ppd on aspn.activestate.com, I did some searching and found this explanation -


Cryptographic Modules

The Canadian Federal Government requires that companies and organizations that wish to distribute cryptographic software get a permit in order to do so. ActiveState does not have this permission. This affects the availability of the following CPAN modules:


 
I'm not offended , its just that installing something(ex.a module) doesn't mean you are re-invent the wheel. You do so, to be able 'not to re-invent' it.

Anyway no harm done. No hard feelings. I hope you will succeed in what you want to do.

Thanks for your offer, i appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top