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

Small but vital changes #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ When you restart/run `apsd` afterwards (`kill` or `launchctl`), after a few fail
### Extract and copy device certificate
#### Extract iOS Certificates

First, download the [nimble](http://xs1.iphwn.org/releases/PushFix.zip) tool, extract `PushFix.zip` and place `nimble` into `setup/ios`. The following script will copy the tool to your iOS device, run it and copy the extracted certificates back to your computer. It assumes you have **SSH** running on your device. I recommend setting up key-based authentication, otherwise you will be typing your password a few times.
First, download the [nimble](https://web.archive.org/web/20140215110845if_/http://xs1.iphwn.org/releases/PushFix.zip) tool, extract `PushFix.zip` and place `nimble` into `setup/ios`. The following script will copy the tool to your iOS device, run it and copy the extracted certificates back to your computer. It assumes you have **SSH** running on your device. I recommend setting up key-based authentication, otherwise you will be typing your password a few times.

Make sure you are in the pushproxy root directory, otherwise the script will fail.

Expand Down
16 changes: 16 additions & 0 deletions setup/genpki.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -sha256 -days 1024 -out ca.crt -subj '/C=US/ST=CA/O=Organization/'

genkey() {
OUTPEM="${2:-$1.pem}"
openssl genrsa -out "$OUTPEM" 2048
openssl req -new -sha256 -key "$OUTPEM" -subj "/C=US/ST=CA/O=Organization/CN=${3:-$1}" -out "$1.csr"
openssl x509 -req -in "$1.csr" -CA ca.crt -CAkey ca.key -CAcreateserial -days 500 -sha256 >> "$OUTPEM"
rm "$1.csr"
}

genkey init-p01st.push.apple.com
mkdir -p certs/courier.push.apple.com/
genkey courier.push.apple.com certs/courier.push.apple.com/server.pem *.push.apple.com
12 changes: 4 additions & 8 deletions src/pushserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@


APPLE_PUSH_IPS = (
'17.172.232.218',
'17.172.232.59',
'17.172.232.134',
'17.172.232.135',
'17.172.232.145',
'17.172.232.216',
'17.172.232.142',
'17.172.232.212')
'1-courier.push.apple.com',
'2-courier.push.apple.com',
'3-courier.push.apple.com',
'4-courier.push.apple.com')

factory = InterceptServerFactory(
hosts=APPLE_PUSH_IPS,
Expand Down
4 changes: 2 additions & 2 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Twisted>=11.0.0
Twisted==12.0.0
biplist==0.4
pyOpenSSL==0.14
pyOpenSSL