apns passphrase

489 views
Skip to first unread message

Anton Vodotyko

unread,
Feb 16, 2012, 8:53:59 AM2/16/12
to apns-php
Is it possible to add a passphrase using php-apns ? Similar to:
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);

fr...@spatie.be

unread,
Apr 30, 2012, 6:02:40 AM4/30/12
to apns...@googlegroups.com
looking for a solution to this problem as well...

Clement Wu

unread,
Jun 11, 2012, 3:19:46 AM6/11/12
to apns-php
I am not sure if this would work for you but I found the Abstract.php
file in the APNSPHP folder has a function called _connect().

I added in my passphrase line of code after the
stream_context_create() like this:

$streamContext = stream_context_create(array('ssl' => array(
//'verify_peer' => isset($this-
>_sRootCertificationAuthorityFile),
'cafile' => $this-
>_sRootCertificationAuthorityFile,
'local_cert' => $this-
>_sProviderCertificateFile
)));

$passphrase = 'enter_your_passphrase_here';

stream_context_set_option($streamContext, 'ssl', 'local_cert',
'mydevelopmentkey.pem');
stream_context_set_option($streamContext, 'ssl', 'passphrase',
$passphrase);



And uploaded my pem file that required a password. I was able to send
push notification.

Note I also changed the line of code which specified my pem file to
the name of my pem file rather than what was shown in the default
source code.

Hope that helps.

汤洪波

unread,
Jul 12, 2012, 4:15:36 AM7/12/12
to apns...@googlegroups.com
Hello, I just add a line like:
stream_context_set_option($streamContext, 'ssl', 'passphrase', 'xxxxxxxx');
and it worked well. So, I want to know why you add a line to specified your pem file before it? Thanks!

在 2012年6月11日星期一UTC+8下午3时19分46秒,Clement Wu写道:
Reply all
Reply to author
Forward
0 new messages