tags:

views:

14

answers:

1

Hi, in my php script that sends a push notification to iPhone, I have the below code.

The SSL certificate requires a password. From the command line, it just asks you for it and you can enter it, but how do I get this script to run automatically without asking for the password? I am happy to have the password hardcoded into my script here

$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort,
    $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);
if (!$apns) {
    echo "$errorString($error)<br />\n";
}

Thanks

A: 

It's just a matter of setting the context option passphrase. Since you're already passing the stream transport constructor a context, I suppose you know how to do that.

Artefacto