Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,372 Programmers. There are 1,467 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Sending request via https in LWP fails

 
Reply to this topicStart new topic

Sending request via https in LWP fails

Petebardo
post 5 May, 2008 - 01:49 PM
Post #1


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12



I am attempting to POST a request using https protocol through the LWP package. For some reason Perl returns an error message, "501 Protocol scheme 'https' is not supported." The message seems to come from Protocol.pm. The package, including support for https seems to be installed, at least the Protocol/https.pm exists. What do I need to do to enable https support?


CODE

#Create a HTTP:Request to the Sandbox server, using the headers and body specified
my $httpRequest = HTTP::Request->new("POST", 'https://$url?', $httpHeader, $requestXmlBody);

#Send the request and get HTTP::Response object
my $httpResponse = $ua->request($httpRequest);

User is offlineProfile CardPM
Go to the top of the page
+Quote Post


mocker
post 5 May, 2008 - 02:16 PM
Post #2


D.I.C Head

**
Joined: 14 Oct, 2007
Posts: 73

Make sure you have a recent copy of Crypt::SSLeay . If you need to install it, you might want to reinstall LWP after. I am not sure if it detects https support during installations or runtime.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Petebardo
post 5 May, 2008 - 03:02 PM
Post #3


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12

Thanks for the help.

I downloaded the Crypt/SSLeay package. When I ran the Makefile.pl, I got this error message:
CODE

No installed SSL libraries found in any of the following places.
    c:\openssl
You will have to either specify a directory location at the following
prompt, or rerun the Makefile.PL program and use the --lib switch
to specify the path. If the path in question is considered standard
on your platform, please consider filing a bug report in order to
have it taken into account in a subsequent version of Crypt::SSLeay.


I have cygwin installed, which includes openssl.exe, version 0.9.8b 04 May 2006. Is there something else I'm missing?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

mocker
post 5 May, 2008 - 03:16 PM
Post #4


D.I.C Head

**
Joined: 14 Oct, 2007
Posts: 73

I'm not familiar with installing openssl on windows. It looks like there is an installer at http://www.openssl.org/related/binaries.html though.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

KevinADC
post 5 May, 2008 - 07:10 PM
Post #5


D.I.C Head

Group Icon
Joined: 23 Jan, 2007
Posts: 168

On a side-note, if you put a scalar in single-quotes its treated like a literal string instead of a scalar:

'https://$url?'

should be:

"https://$url?"
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Petebardo
post 6 May, 2008 - 10:00 AM
Post #6


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12

Thanks KevinADC. The url is actually a literal string in my code. Not wishing to reveal too much, I changed it for this post but didn't fix it for interpolation of the variable.

The problem I am having at this point is really installing openSSL. I installed
the compiled package from SourceForge into folder named GnuWin32 then tried to point makefile.pl to it as the directory both as E:\GnuWin32 and as E:\GnuWin32\bin and still get the same error message:

CODE

Which SSL install path do you want to use?  e:/gnuwin32/
e:/gnuwin32/ does not appear to be an SSL library installation, since
the required header files were not found. The build cannot proceed.


I've tried both forward and backward slashes in the path with no luck. What am I missing?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Petebardo
post 6 May, 2008 - 11:35 AM
Post #7


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12

Well, I installed openSSL from Shining Light Productions--the one openSSL.org points to. Then ran the makefile.pl for SSLeay. It ran ok, at least it didn't report any errors. It asked if I wanted to run the tests. I answered yes, but then nothing happened. It just went back to the system prompt.

At this point I should emphasize I'm running Windows Server 2003.

What do I do now?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

KevinADC
post 6 May, 2008 - 12:45 PM
Post #8


D.I.C Head

Group Icon
Joined: 23 Jan, 2007
Posts: 168

On windows try using Nmake.

c:\perl\bin\nmake /?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Petebardo
post 6 May, 2008 - 02:38 PM
Post #9


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12

That doesn't seem to be a valid command on my installation. I'm using 5.6 from ActiveState. I don't have a c-compiler.

QUOTE(KevinADC @ 6 May, 2008 - 12:45 PM) *

On windows try using Nmake.

c:\perl\bin\nmake /?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

KevinADC
post 6 May, 2008 - 04:54 PM
Post #10


D.I.C Head

Group Icon
Joined: 23 Jan, 2007
Posts: 168

You may have to download Nmake.exe it fom the MS website. Not even sure it will work as activeperl uses the PPM application to manage modules.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Petebardo
post 6 May, 2008 - 05:11 PM
Post #11


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12

That kind of scares me. I don't know what it is or what it does. The computer I'm using is not purely development. Regardless, I'll have to do something on the production server at some point, and I can't afford to have it fail.

Thanks for your help, but I think I'll put this project on the back burner for a while.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 02:38AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month