Dear People,

I (still) have a problem with secure connecting through a socket.
The other side see me comming in because they have to allow me on my ipnumber and evertime i run this script they see me coming in they say, but i get a connection refused error.

As i've been fighting with this problem for a while now i might as well better describe the situation.

It's Linux Mandrake 8.2 and at startup it defaults to linux-secure (if that means anything)

This is what i have running for openssl:

/usr/bin/openssl
/usr/include/openssl
/usr/local/ssl/bin/openssl
/usr/local/ssl/include/openssl

And this is installed for the Crypt::SSleay module:

/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Crypt/SSLeay
/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Crypt/SSLeay/SSLeay.so
/usr/lib/perl5/site_perl/5.6.1/i386-linux/Net/SSL.pm
/usr/lib/perl5/site_perl/5.6.1/i386-linux/Crypt/SSLeay
/usr/lib/perl5/site_perl/5.6.1/i386-linux/Crypt/SSLeay.pm
/usr/lib/perl5/site_perl/5.005/i386-linux/Crypt/SSLeay
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Crypt/SSLeay

I have The following script to test:

#!/usr/bin/perl
 
use IO::Socket;
use CGI qw/:standard/;
 
require ("HtmlElements.pl");
 
require ("/usr/lib/perl5/site_perl/5.6.1/i386-linux/Net/SSL.pm");
 
$q = new CGI;
 
&printHtmlTop;
 
#Get Date
 
$wday = (Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun)[(localtime)[6]];
$mday = (localtime)[3];
$mnth = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[(localtime)[4]];
$yr = (localtime)[5] + 1900;
  
$invoice_date = "$wday, $mday $mnth $yr";
 

# Get Form Information
 
$type = $q->param('type');
$card = $q->param('card');
$firstname = $q->param('firstname');
$lastname = $q->param('lastname');
$address = $q->param('address');
$email = $q->param('email');
$phone = $q->param('phone');
$creditcardnr = $q->param('creditcardnr');
$month = $q->param('month');
$year = $q->param('year');
 
$Expiry = $month . $year;
 

$TransactionType = "A";
$ServerAddress = "some.ecommerce.com";
$ServerPort = "443";
$Merchant = "secret";
$street = ""; #international customers
$zip = ""; #international customers
 
 
 
# Send authorization request
&FAC_authorize;
 
### This subroutine sends the data to FAC and receives the transaction results
 
sub FAC_authorize {
 

# the following variables will be used as arguments for the cGateInterface java
 program:
 
$in1 = $transActionType;
$in2 = $ServerAddress;
$in3 = $ServerPort;
$in4 = $AuthorizeScript;
$in5 = $card;
$in6 = $creditcardnr;
$in7 = $Expiry;
$in8 = $Merchant;
$in9 = $CustomerId;
$in10 = $Invoice;
$in11 = $street;
$in12 = $zip;
 
my $host   = shift || $in2;
my $port   = shift || $in3;
 

$sock = Net::SSL->new(PeerAddr => $host,
               PeerPort => $port,
              ) || &Error("Can't connect to $host:$port");
 
$sock->print("GET /$in4?cnumber=$in6&exp=$in7&amount=$in5&invoice=$in10&zip=$in12&street=$in11&mid=$in8 HTTP/1.0\n\n");
 
$buf = '';
$buffy = '';
 
while ($sock->read($buf,1024)) {
 
$buffy = join ('',$buffy,$buf);
 
}
 
($header,$body) = split (/\n\s+/,$buffy);
 
 foreach (split(/,/, $body)) {
 
  ($NAME,$VALUE) = split(/=/, $_);
 
  print "$NAME - $VALUE\n";
 
  # this loads the FAC responses into an array called out_all
  $out_all{$NAME} = $VALUE;
 
 }
 
}
&printHtmlBot;
exit;



What happened is that this was running fine on another machine.
Then when i first tried it on the Mandrake after installing Crypt SSleay with an RPM, because i saw openssl was installed by default, it didn't work because it couldn't find SSL.pm in @INC. This found very strange, because the paths where there indeed, but it just wouldn't get it.
Oh ja, i first tried to install crypt-ssleay the normal way with make and all, and then it asked me against which openssl version i wanted to build it. the [/usr] or [/usr/local/ssl], i choose the last one and then it would install because it was missing all kinds opf things and came back with error1 etc. So i tried it the package way and that (the same version) installed easy and no complaints.
Maby it choose to install against the first openssl , i don't know but that's how i end up with the all the paths above.

So then i got these errors about SSL.pm not to be found in @INC. Even if i pushed the path to Net/SSL.pm in @INC it couldn't find it.

Now that i use require and point it allthe way to SSL.pm i get this error:
Connect failed: connect: Connection refused Connection refused at /usr/lib/perl5/site_perl/5.6.1/i386-linux/Net/SSL.pm line 87. This is the final part of the connect routine of this module.

Then i contacted the verification company and we did some tests and they see me comming in their system (they filter on IP) and they haven't changed any of there settings and they don't really seem to have a clue either.

So what i'm afraid of is that the error that i'm getting from perl is a bit misleading.
I just don't know what to try anymore.
I don't feel like reinstalling a whole system, and i don't really know how to delete forinstance both openssl installations if that would be nessary. The mandrake software installer i don't fully trust either to be honest. Especially not with de-installing, also because if i asked him to find for installed openssl versions he only finds one, while the crypt-ssl module on install askes aginst which openssl installation i would to build. But then on the other other hand i wouldn't have a clue how to fully erase an openssl installation from my system by hand.

So if anybody has an advise other on wath to try or what to check other then mentioned above, i would appreciate it a lot obviously :-)


Sincerely,

Dirk van der Giesen

Reply via email to