Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9094217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:18:01+00:00 2026-06-16T23:18:01+00:00

I have to send push notification to iOS devices. My connection has to be

  • 0

I have to send push notification to iOS devices. My connection has to be enabled through a proxy. I tried everything but without success. I have an error 110 Connection Timed Out. It’s working with cURL if I just try to connect to Apple push’s address. I don’t know where the problem is. Proxy config ? PHP stream_context wrong implementation ?

Here’s my code :

$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'certificate.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', 'my_passphrase');
stream_context_set_option($ctx, 'ssl', 'verify_peer', false);
stream_context_set_option($ctx, 'http', 'proxy', 'tcp://my-proxy.net:8080');
stream_context_set_option($ctx, 'http', 'request_fulluri', true);

$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err,$errstr, 60, STREAM_CLIENT_CONNECT, $ctx);
var_dump($fp);
var_dump($err);
var_dump($errstr);
exit;

Do you have an idea ?

EDIT:

Can it be directly linked to Squid ? I just figured out the proxy is running with Squid.
I also try with fopen() function instead of stream_socket_client() but it seems it doesn’t allow ssl protocol.

Here’s my var_dump outputs : bool(false) int(110) string(20) “Connection timed out”

I also have this warning : Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection timed out) in /share/www/website/test.php on line 22

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:18:02+00:00Added an answer on June 16, 2026 at 11:18 pm

    It could simply be your proxy does not allow port 2195 to be opened.

    iPhone Push Notification Unable to Connect to the SSL Server

    I guess you either:

    • Need to talk to the people who run the proxy to see if port 2195 is open or not.

    or

    • Setup a test server listening on port 2195 and then try to do a test connection to it through the proxy. That should allow you to test if it is the proxy that is blocking the connection requests.

    or

    • Test whether Curl can open the connection using a proxy.

    Which is done by setting the options:

    // sets the proxy to go through
    curl_setopt($ch, CURLOPT_PROXY, $proxy);
    // sets to use a tunnel proxy which most http proxies are
    curl_setopt($ch, CURLOPT_HTTPTUNNELPROXY, $proxy);
    

    Full testing code here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using https://github.com/Redth/APNS-Sharp to send push notification message to all devices where
I'm trying to send push notification to Android devices, but getting an error in
I have azure mobile server and i want push notification using scheduler job, But
We have implemented PushSharp for sending push notifications to our enterprise iOS devices. This
I am using the Java-APNS framework to send push notifications to iOS devices. It
I can send push notification to an IOS device (IOS 5.1 IPAD 3rd gen)
I have java application and I want to send push notification. I use nontoop/apns
I have some doubts with Meteor server? Whether will it send push notification like
I have got trouble when i send push notification to phone it returns with
I want to send push notification to certain users only. From what I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.