How do I handle the APNS switch from SSL3.0 to TLS in PHP?

For security issues in SSL3.0, APNS will remove support for SSL3.0, and then all providers that only support SSL3.0 will now need to support TLS. In my case, I used a set of PHP providers like this:

        ...
        stream_context_set_option($ctx, 'ssl', 'local_cert', $certFilePath);      
        stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);                 
        stream_context_set_option($ctx, 'ssl', 'cafile', 'entrust_2048_ca.cer');   

        $apnsServiceLocation = 'ssl://gateway.push.apple.com:2195';   
        ...

      

I found a solution just changing the APNS service url:

        $apnsServiceLocation = 'tls://gateway.push.apple.com:2195'; 

      

+3


source to share





All Articles