ios - 'Unable to set private key file' attempting to send push using php -
i'm using ray wenderlich push tutorial reference set push app, have done dozens of times before, literally dozens, , gone smoothly, until now.
when executing php file manually test sending push i'm getting error:
'unable set private key file ... ck.pem'
at last line:
$ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem'); stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); // open connection apns server $fp = stream_socket_client( 'ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, stream_client_connect|stream_client_persistent, $ctx);
ck.pem concatentation of ssl certificate , private key , can use these sussesfully following command:
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert pushcert.pem -key pushkey.pem
when execute big spiel , output regarding ssk handshake reading/writing n bytes indicates sucessful , certificate , key must valid.
so don't understand why there no problem using certificate , key separately when used arguments openssl command line above there when used in concatenated in php file.
after getting problem deleted - clearned out certificates , keys keychain, deleted provisioning profiles etc. whole lot , started clean slate again make sure didn't make mistake somewhere. same results - keep getting 'unable set private key file'.
i saw past posting had same problem , solved executing php file using sudo, didn't work me.
any suggestions, driving me mad, i've done before dozens of times sucessfully.
i had once, after many hours of frustration tracked problem down fact using textedit edit .php file's contents , textedit inserting invisible characters.
not @ end of line, in line i.e. if original text in ray wenderlich file this:
// put private key's passphrase here: $passphrase = ‘cpushchat';
then after using textedit change password looked when viewed it:
// put private key's passphrase here: $passphrase = ‘mypassword';
but if viewed in hex edited, textedit has done insert invisible (invisible in in text viewer) characters this:
// put private key's passphrase here: $passphrase = ‘e28098mypassword';
which resulted in password being incorrect of course , leading message.
Comments
Post a Comment