https ssl problem

Hi there

I’m currently working on Perl script that uses LWP and Crypt::SSLeay libraries to receive data from security enabled website. This website uses client certificate authentication methods which implements PKCS12 certificate file and corresponding PASSWORD. My script is as follows:

use LWP::UserAgent;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
$ENV{HTTPS_PKCS12_FILE}     = 'FILENAME.pfx';
$ENV{HTTPS_PKCS12_PASSWORD} = 'PASSWORD';
my $ua  = LWP::UserAgent->new;
my $response = $ua->get('https://example.com/logon.asp');
print $response->content, "

";

When I run this script under Windows and Debian - it works correctly, but under OpenSuse 12.1 it behaves like if “FILENAME.pfx” cerificate file is not supplied. The same results are true for both system default Perl installation and for ActivePerl. So i guess the problem is related not with the Perl distribution itself, but rather with some core system’s functionality.

Any ideas?
Thanks

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> it behaves like if “FILENAME.pfx” certificate file is not supplied.

I see that you provided that in the script, but is the file there? Have
you tried using an absolute path to ensure it is not looking in a
directory other than what you expect? How, exactly, does it lead you to
believe that the “file is not supplied” (what is the error message
exactly?)?

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPCvMvAAoJEF+XTK08PnB5pRAQALBZ5EQhyxVD0IcH58FLE/uo
ZFx9kdQNfNGHikTBcpKYl8f10sWLBY6va3pGe1ZJzWbV+8VK9gxYZlUMpNnbC80I
DP8WYvCB51WyekU3zVpj8/n9N640p8+bxsDq5+TUNQNcm0Q93gNjSb51lv9/45rP
T9/EV/KK9Osq7IaMooDrnselh4GGOGk235pG+G3W5WW14DgaxWL1lZmBXQtAcYYZ
t/RTjX0oVvCv1YsZ/LV8IGvLT2S7vI0Xi8TW+1t9vJyrfmsFaxiuu1nFuJh40Ctx
z6gT6nKNlgmqUS5Hc6fhArFaUITjk9smXFz8W20CRn3YEtzL487NOQ2oaY9nzzKA
elXmiTTY5ZmP8ECktPyYFOP6mf/rIt1vXSOCB25telmYW7u0//ewCYBB6jmgPMsR
DDQ0TtiMQwHn1dJsxCfzMiYRYC/wSBWU+iYwkbSZoYRK2jIvO3f5tZ1d6hnRzpfb
IGBhFjKfFMfPu8jcXi7ZFa8e42WIz4eHEz6m2qv0pa2gj39oUjqVs7p82MZ2yKXg
148MQpnvPNGGOuPxe9ZYC1zQ9dlzVgfOvJ61AeyZV/Lv4vIjj/QEe3H95OHNfbFC
7leueiaTSaBPEZFEoc3wySMuL/OgJMwXsKKKKeBl48EkgsK1mPP6aDPDsdpmIvDm
SQpus34cBDliyrY2z2oc
=gfzU
-----END PGP SIGNATURE-----

Sadly i can not supply you with certificate file, because it’s a confidential info :slight_smile:
That file resides in the same directory as script itself. Advised by you, i tried to supply full directory path to that file, but results were the same.
Any way, when i copy the entire script’s directory to Debian machine and run the same script, everything works perfectly.
Theres no nor can’t be error message about missing file. When i run the script on Debian, it prints login page. On Suse - it prints me a page with a message about missing certificate. Even when i supply to the script wrong file name, or leave script without this parameter at all - nothing changes, results are the same.

I did some additional testing, and discovered some odd thing.
Now the funny thing is, that on both Debian and Windows, when i supply wrong filename for the certificate, script prints an error message about missing file:

500 configure certs failed: aFILE.pfx file does not exist: No such file or directory

There’s no such thing on SuSe. Regardless of filename supplied, script behaves identically - it prints me a webpage with message about missing certificate :\

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That you do not get a different error message when you put in blatantly
incorrect file names still tells me that it is not finding your file in
the first place, or I suppose the Perl module could simply never tell
you about a bad file, but then your Debian install does which likely
uses the same code. Are you using ‘perl -w’ to start things, or even
setting ‘use strict;’ somewhere to see if you can find odd quirks caused
by those types of problems?

How did you build the .pfx file exactly? What are the various perl*
package versions on OpenSUSE and Debian?

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPDEZ9AAoJEF+XTK08PnB5VwgP/0hRY/gu47JfO5Rj50h/Xqqk
wxzJb9nySVAiZsrEnQ0WjC8IELvWQFIrzRkEruGhAYr2GhAPVOhezueXpnINilLe
vhSs3BtpbXv2AteNLlloj+6XJvu4sI72a+zw15HYb+x8EIf7iY2Bej/pzOxkZ3Sr
QSNpbUVvc50g9HVCiAUMM9mFhmkfUODMeM9LQQFZYoWErPYC98c9W9ohAHVGXp9Q
GVIpgGhniddOieXb6CvaoBV/8LBNHtm/njKoEEu5CLbgJw/KgziJVmFGlY9jWFHJ
O8Xa+saPsL7TE+PYLxvZSGw7tnyw5IEe2b2EY77WG1TsonGtgsdS9MzrLFp7YTbA
f1Cn7VYB01ApfLGthFGBbSzv6ClWUsoGoNK8ikG5Z9dWVl6C0//quvF8B00vW8om
Nxymw+IMRdzf1YFzbwyn4jI0NkpmvAVX5uFp3nPB2bRxIhfBizpmfx5TKq5Tw9z0
G9xW9KpY1it7ZgMzsFxLViLXG+YHsMFy1EdVzI2V3OqPrh4P2v1d6M+DzNHup7ke
FC6PTxOqB0biT4MRwbhvMKJ8UmUe86WcL/wbLbwVjORF+duv39pOeZqc1um4dEf6
BjDjvuVU4tPgMXedmmRdkRdCEQuzi5Atx3KzJlk007+Rj7GKa5g9TWKbSE/zU1cl
Zp65PHfcFeAko6NQba4l
=/qn+
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A bit of an update… on my 11.3 system using perl-Crypt-SSLeay 0.57 I
get nice message about what his wrong when I omit the file completely:

500 configure certs failed: FILENAME.pfx file does not exist: No such
file or directory

If I try the same thing on my 12.1 system I get, as you did, messages
from the web server instead. My 12.1 box, though is using 0.58
(current) of this Perl module, so my guess is that something changed
there. I have not yet tried copying over the Perl module from one
system to another, but that seems like the most-likely culprit at this
point.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPDE2ZAAoJEF+XTK08PnB5738QANG0oODIS/9nU48xfGtCAyi2
EUJetTedxhuqYYFC5f+F0TSoDnGP2rsxvJWINAdW+NrcnL4nb6Wsk/qy9CDvyeSd
AKKFwHBYHNOmuEckiG2f9H/Df23P7ktCbz4SGIG3lhdie88H+uce6Lqjw/nsQmQl
WRe3yiM1p5RhmJ6G2QNJdcuuF2NRjcrc3qm0jWjcycqksqPcEl9BT7In8BvIo3sM
LlpFM06KQxLF0uSceKyhGI9cbBE79zp+RJaT/V/aR1TMTUp9TcraN9558GosQcvS
pggr0LYCZSRLmza8CRUiuO1wsTzx3pSEeHlWBOVwawRPTUVCGyFfjg5H3MQsKYFF
jmiLVIleEkU8WkRtomlshLR0UjSq3lrWbPUwCIXx5Xyy7G1Q7d6BwI05fYvcIVme
CvBWWZhO4OqBeQJUbNfSlqW2YxdsQbf6s+vqPdFtxBC5EwsB97eDjDClRZiYSAV+
HzmJnde14tn1fcQiL3XmnLAn/Yiy2foJTQ6TaqeGhp9u4/WDcA+zyinoyopkeEaK
OrOUHWzSdjaKxCCL2Kss10OAeco6Dbr1F4POIOWzWpobEOjUNuDqT7GFuVLmRaUw
theHgWTaKP+HnqVH8RjcP8wqb63StNA91RBQZyUlhEc9o4hpmwJI1p+6IPv+ztzL
ydh4uvPfI6arv22h6Apj
=4nAN
-----END PGP SIGNATURE-----

thanks a lot, i already started to loose my faith :slight_smile:
will try to find a solution, now at least i know where to look
thanks again