Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've got an application that uses PFProAPI.pm for credit card processing. It has been running successfully for one client, under Apache2/mod_perl2, for about a year and a half. I'm in the process of setting it up for another client. I've got it working correctly under CGI, but whenever I try to process a payment under mod_perl I get the error:

"The certificate chain did not validate, no local certificate found, Cert Path"

I can't figure out what is different in the mod_perl environment. The environment variable PFPRO_CERT_PATH is set in the shell, is also set using SetPerlEnv right after loading mod_perl, and is set again in the application using $ENV{'PFPRO_CERT_PATH'}='/usr/local/certs/'. As far as I can tell, the permissions on the file and directory are set correctly.

Anyhow, I'm about ready to pull my hair out on this one. Any ideas? I just don't see why the application is working correctly from normal CGI but not from mod_perl. I'm using Perl 5.6.2.
  • Comment on Yet Another PayFlow Pro problem (mod_perl)

Replies are listed 'Best First'.
Re: Yet Another PayFlow Pro problem (mod_perl)
by Anonymous Monk on Jan 17, 2006 at 03:10 UTC
    As far as I can tell, the permissions on the file and directory are set correctly.
    What are the permissions exactly ?
      On the directory with the certificate:

      -bash-3.00$ ls -Fla /usr/local/certs
      total 16
      drwxr-sr-x 2 root root 4096 Jan 3 12:04 ./
      drwxr-sr-x 14 root root 4096 Jan 3 12:04 ../
      -rwxr-xr-x 1 root root 993 Jan 3 12:04 f73e89fd.0*

      These match the ownership/permissions on the server at the client where the application is working correctly.
Re: Yet Another PayFlow Pro problem (mod_perl)
by Anonymous Monk on Jan 18, 2006 at 01:07 UTC
    I think I've fixed the problem. I created a startup.pl file which included a BEGIN block that set $ENV{'PFPRO_CERT_PATH'} to the correct location. Apparently something important has already happened with the client library by the time the variable was being set other ways.