Skip to content

Can`t use an ip address in the 'new ApnsClientBuilder().setApnsServer' method. #917

Answered by jchambers
keepbang asked this question in Q&A
Discussion options

You must be logged in to vote

How to use IP address?

Generally speaking, you can't.

While it might be technically possible to hack things such that you'll wind up with code that "works," it would be brittle and involve some significant security compromises. There are a few issues at play here:

  1. X.509 certificates have a "subject name," which in practice says which domain they'll work with. In particular, the subject for the APNs certificate is subject=/CN=api.push.apple.com/OU=management:idms.group.887777/O=Apple Inc./ST=California/C=US, which means clients should only trust it for api.push.apple.com; if you're connecting by IP, clients will check to see if the certificate's subject explicitly names that IP (which i…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@keepbang
Comment options

@jchambers
Comment options

Answer selected by keepbang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #916 on September 17, 2021 14:28.