Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect #85

Open
prabhatVinsol opened this issue Apr 5, 2022 · 15 comments
Open

Unable to connect #85

prabhatVinsol opened this issue Apr 5, 2022 · 15 comments

Comments

@prabhatVinsol
Copy link

prabhatVinsol commented Apr 5, 2022

When selecting the certificate this error is coming
"Unable to connect: Socket connecting failed (-1)"

Not able to find any help to figure out why this is happening and how to fix this.

@pertau
Copy link

pertau commented Apr 6, 2022

Same here.

The macOS app works fine, but the push from iOS code fails with this error.

@dhiren92
Copy link

dhiren92 commented Apr 7, 2022

same here

@saormart
Copy link

Same here....

@saormart
Copy link

It seems that this issue is something to do with the legacy Binary Interface (gateway.push.apple.com) which was retired March 31st, 2021 (https://developer.apple.com/news/?id=c88acm2b). It includes the sandbox as well...

@newpgt
Copy link

newpgt commented Apr 16, 2022

same...

1 similar comment
@cloverfiled344
Copy link

same...

@Biolazard
Copy link

same.

@Ian-Seungho-Lee
Copy link

+1

@georgbachmann
Copy link

Same here... :( does anybody know an alternative that is still working?

@BratislavBaljak
Copy link

Same here

@tmaly1980
Copy link

Any luck?

@MagFer
Copy link

MagFer commented Jun 7, 2022

Same here

image

@MagFer
Copy link

MagFer commented Jun 7, 2022

I've seen there are some contributors listed in the repo let's see if someone knows how to fix it 🤔.

@Sergey70
Copy link

same

@yawillianpsb
Copy link

"Unable to connect: Socket connecting failed (-1)" means that you trying establish connection which cannot be established.
In my case i've created new push certificates, and push certificates named by new prefix like Apple Sandbox Push Services: instead of Apple Development IOS Push Services: .
So I need to use API which doesn't implemented in NWPusher.
You can interact with new API via curl requests from terminal as described in documentation here1 and here2
In my case code for terminal is:

DEVICE_TOKEN=enter_here_your_device_token; \
TOPIC=enter.here.bundleId.of.App; \
CERTIFICATE_FILE_NAME=path_to_CER_format_of_push_certificate; \
CERTIFICATE_KEY_FILE_NAME=path_to_PEM_format_of_push_certificate; \
APNS_HOST_NAME=api.sandbox.push.apple.com; \
curl -v \
--header "apns-topic: ${TOPIC}" \
--header "apns-push-type: alert" \
--cert "${CERTIFICATE_FILE_NAME}" --cert-type DER \
--key "${CERTIFICATE_KEY_FILE_NAME}" --key-type PEM \
--data '{"aps":{"alert":"test"}}' \
--http2  https://${APNS_HOST_NAME}/3/device/${DEVICE_TOKEN}
  • CERTIFICATE_KEY_FILE_NAME mush be in PEM format, it means to open this file you dont need enter the password. So if you have certificate in .p12 format you can translate it to PEM format via (it requires password for this file):
openssl pkcs12 -in push_cert.p12 -out push_cert.pem -nodes -clcerts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests