From reading the documentation on openssl_pkey_get_private it appears you need to specify the full (absolute) path.
Using URL::site
would append http://
and thus you would get:
file://http://localhost/../../private/private
which is invalid. I guess that causes your next function call to fail. The solution would be to either
- Load the private key into a string and pass that or
- Use a function like realpath to get the absolute path.
PS: Don't forget to accept correct answers otherwise you'll get a lower response rate in the future.
The Pixel Developer
2010-07-14 14:05:41