I have some PHP scripts in the following directory structure.
ROOT
---COMMON
------(Login.php)
---APPSERVICE
------(NotificationService.php)
------NOTIFICATION_CERTIFICATES
---------(ck.pem)
In NotificationService.php
, I have the following line in my "notifyUser()"
function:
stream_context_set_option($ctx, 'ssl', 'local_cert', **'NOTIFICATION_CERTIFICATES/ck.pem'**);
However, when I include NotificationService.php in my Login.php script and try to call notifyUser(), it gives me this error:
stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure in [my file path]
However, if I call notifyUser()
from a script in the same directory as NotificationService.php
, there is no error. Why does the bolded line above seem to be affected by the script calling the function, rather than the location of the script that the function is defined in?