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 Chriss Miller 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
Mar 12, 2001
333
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
 
Thanks Missbarbell, but Crypt::SSLeay was not found when I tried to install it from PPM. If I could get that installed maybe that would help, I dont know.

You've never had to do SSL stuff, miss?
 
It may not build from PPM, if ActiveState have not been able to build a clean ppm distribution. In which case, you can use CPAN.pm or CPANPLUS.pm (see faq219-1687) to install it, or download it from here, and install by hand.

I haven't had a need to use SSL as yet :)

Barbie
Leader of Birmingham Perl Mongers
 
Thanks again for the reply.

Well PPM works fine, Ive installed plenty of modules from it. However, when I do a search for SSLeay it finds nothing.

I will try installed it by hand. I downloaded the file you pointed me to. I am running on a Win2k machine, and I do not have ready access to a C compiler. Do I need one to install this? It looks like it contains a makefile etc.
 
when a module does not contain any *h, *c, *cpp, etc files you dont need to compile with c.
so for Crypt::SSLeay

c:\Crypt-SSLeay-0.51\makefile.pl

bla bla

c:\Crypt-SSLeay-0.51\nmake

bla bla

c:\Crypt-SSLeay-0.51\nmake install

ready to use

good luck!
 
but correct me if i am wrong (Barbie) dont you need the OpenSSL first?
and that yes you need to compile with C
 
Thank you perluserpengo, but it seems that the first step of the install is to indicate where my openSSL installation is at. I downloaded the newest openSSL, and now its telling me that to install it I need a C compiler.

This is getting to be quite a handful. I thought my machine would already have SSL libraries that I could point Crypt::SSLeay to.

I did find this though in the SSLeay README:
Code:
NOTE for Win32 users, few people seem to be able to build
      W  Crypt::SSLeay successfully on that platform.  You don't need
      I  to because ActiveState has already compiled it for you,
      N  and is available for their perl builds 618 & 522 as a ppm
      3  install.

So, what does that mean? Do I have build 618 or 522? This is the file I downloaded from ActiveState.com

ActivePerl-5.8.6.811-MSWin32-x86-122208.msi

please help
 
when you install modules from PPM (which comes with ActivePerl) then of course you dont need to do anything, ActivePerl PPM takes care of everything,
but when you do it manualy then sometimes you have to 'compile'.
And in your case there is no Crypt-SSLeay.ppm avaliable at this time.
Although it was in

ppm> rep add TheoryX
So..

Now from what i see installing OpenSSL is not hard, you just compile it with C and optionally use a little assembly,
when you 're done with this,
then you install Crypt-SSLeay, but first of all you have to make some changes to the config file of the OpenSSL considering the installation path.

There is a Readme in Crypt-SSLeay (first read this) and then read the Installl.Win32 file which is in OpenSSL
I hope you will make it. Its not easy , but i find it simple
 
Paul,
Am i helping this guy or is it better to shut up?
 
Hi again pengo,

There is no reason I should have to install OpenSSL on a web server running IIS 5.0. Im going to have to put Perl on a few different machines in the future, and this does not look like a simple install.

I already have SSL libraries, i mean this thing is a webserver, why should I use openSSL? It'd be one thing if that solution was exceedingly quick, but it isn't.

I just found build 618, and tried installing that since the README of SSLeay lead me to believe it would have SSLeay. It did not have a compatible version for install via PPM, so now im back on the latest build of Perl. Im gonna stick with this one and keep banging away.

thanks for the help so far

 
Yes, Paul, I see you post in here all the time, so I thought id request you assistance.

any experience with this on a windows box?

/sighs
 
pengo, by all means, if all you can do is help someone, and they resist, truly you're better off ...

You've made an effort above and beyond the call ;)

Stran,
are you calling me out? ..;P

I already have SSL libraries
Have you got perl modules that can use them?
which ActivePerl-5.8.6.811-MSWin32-x86-122208.msi
Build version +google might have an answer, if you ask nicely


Hey f**kit, if you ask nicely,who knows

Code:
look how much information you got for realitively F-All, from people willing to help, but decided English musn't be your first language because of your arrogance in the use thereof;

i wrote that
--Paul

cigless ...
 
Im not resisting. Pengo was offering suggestions i've already tried weeks ago. I don't want to have to re-invent the wheel if at all possible.

Any help would be hot. Thanks for the reply, Paul. No, as of yet there is no PM install for Crypt::SSLeay ... and every time I try to do what the readme says I end up going in circles.

thanks again
 
So im just asking if theres anyway to do this without having to install OpenSSL. I dont mean to seem needy or greedy. Im a constant contributor and I love to help and I totally understand how this could look like im not grateful. Im looking for a specific answer, but maybe it just isn't out there.

Thanks again everyone for you time and your eye-strain

stran
 
Pengo! Thanks man!

I put the latest build back on my machine, and then used the PPM install for Crypt::SSLeay that you posted. It worked! It installed SSLeay just fine, and I just ran my spider.pl and it worked without a hitch!

It did everything I expected, and I can't thank you enough. Already gave ya a star, but if you ever need help with front-end web technologies, or cold fusion or javascript or CSS please let me know.

Thanks miss and paul, too!

see yall
 
is there a problem with just installing the binaries at the ppd pengo had above? no compiling, that gets you a binary dll or two without having to worry about openssl. Worked fine with whatever version I'm using at work. Did you attempt the ppd and it failed because of your version of perl?

google gave me this, which would have saved me a solid day about a month ago: the important part being:
Installed Crypt-SSLeay (used 'install at the ppm prompt)
- it wasn't available by searching the default repositories in ppm.

or in my skimming of the thread, did I miss the point?

________________________________________
Andrew

I work for a gift card company!
 
Thanks ICRF

Nope, you hit it right on the head. Yep, I finally used Pengo's suggestion and it worked. I should send this guy who wrote the SSLeay.PPD some cash. He saved me a lot of money just now.

 
There used to be a ppd for it, but it seems to have disppeared, or at least is being differently rendered...

talk 2morrow
--Paul


cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top