Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple Push Notifications and Port 2195

I'll be using JavaPNS to implement my server side of things of the push notification service. I don't have control over what ports are open on the server, but assuming that all ports are open for outbound connections, do I have to also open port 2195 for inbound connections? Correct me if I'm wrong, but my understanding of TCP is that when I make the connection with the Apple server, a source port is randomly assigned to any port not being used and when the Apple server responds (the inbound connection), it will come through that source port. So, my theory is that port 2195 does not need to be open for inbound connections. Is that right?

Also, if the response comes through the random port, doesn't that mean that that port needs to be open to inbound connections? How does the firewall manage this since only a few ports will be indefinitely open for inbound connections? Does it leave the random port open only temporarily for this specific request-response session?

like image 758
AxiomaticNexus Avatar asked Feb 13 '23 09:02

AxiomaticNexus


1 Answers

You only need port 2195 to be open for outbound connections (and also port 2196 for the Feedback Service).

You don't have to open any port for inbound connections, since Apple doesn't initiate the connection to your server - your server initiates the connection to Apple.

like image 168
Eran Avatar answered Feb 23 '23 20:02

Eran