meathouse has asked for the wisdom of the Perl Monks concerning the following question:
Project & Env - I'm migrating a legacy server from A->B. It is CentOS4 i686. The code base seems to be a very organically grown mix of libs and modules all over the place. Oh, and it uses Apache 1. Giving the code and deps a much needed update is not in the scope of the project. All I am tasked with is moving from A->B which happens to be a physical server at data center A, to a virtual server at data center B. The server's primary function is a user login page (cookies) that redirect you to another server where actual user accounts live. Let's call that server C.
I have Server B up and running and most of the software is working except for one big gotcha. If I attempt to use the log in code on http (port 80) I am happily redirected to my account on server C. If I attempt to use the log in code on https (port 443) I can load server B's web page fine, but submitting the page gives me this error (from CARP).
The Error501 (Not Implemented) Protocol scheme 'https' is not supported (Crypt: +:SSLeay not installed) Location: https://server_c.company.com/users/ Content-Type: text/plain Client-Date: Tue, 08 Jul 2014 00:21:09 GMT Client-Warning: Internal response LWP will support https URLs if the Crypt::SSLeay module is installed. More information at <http://www.linpro.no/lwp/libwww-perl/README.SSL>.
I've spent the last few hours.. OK days.. trying to figure this out. First off let me clarify that Crypt::SSLeay is installed. Twice. Here are the two dirs
The first dir install was done via CPAN. And the second was copied from server A. Note that 99% of the server install base lives in under the /usr/local/ray root directory. Also note that Server A does not have a CPAN install of Crypt::SSLeay, it only has the one under /usr/local/ray.
I've attempted to force the login code to use Crypt/SSLeay with "use lib". I looked into recompiling from source. So far no joy. Here are the relevant sections of code on the login page.
Abbreviated codeAny advise is appreciated.#!/usr/bin/perl use strict; use lib '/usr/local/ray/www/site_perl'; use Apache::Constants qw(:common); use CGI qw(:standard); use CGI::Carp; use LWP::UserAgent; my $cgi = new CGI; my %p = $cgi->Vars; $p{credential_0} =~ s/^\s+|\s+$//g; my $server= 'server_c'; my $domain= 'company.com'; ## Set protocol based on what the user wants ## some might use http my $protocol = 'http'; ## And for https... if ( $ENV{HTTP_REFERER} =~ /^https:/ ) { $protocol = 'https'; } ## This is the server that the user will be redirected to my $url = "$protocol://$server.$domain"; my $dest = '/users/'; my $creds = "credential_0=$p{credential_0}&credential_1=$p{credential_ +1}&destination=$dest"; my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 }); ## Post the credentials my $req = HTTP::Request->new(POST => "$url/LOGIN"); $req->content_type('application/x-www-form-urlencoded'); $req->content($creds); ## Get the response my $res = $ua->request($req); ## Change location to their server $res->header( 'Location' => "$url/users/" ); ## Print to browser print $res->as_string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Crypt::SSLeay not installed
by syphilis (Archbishop) on Jul 08, 2014 at 01:13 UTC | |
by meathouse (Initiate) on Jul 08, 2014 at 02:02 UTC | |
by Anonymous Monk on Jul 08, 2014 at 02:10 UTC | |
by meathouse (Initiate) on Jul 08, 2014 at 02:58 UTC | |
by Anonymous Monk on Jul 08, 2014 at 03:20 UTC | |
by meathouse (Initiate) on Jul 08, 2014 at 18:12 UTC | |
by Anonymous Monk on Jul 08, 2014 at 18:47 UTC |