mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-23 11:22:42 -06:00
minor things
This commit is contained in:
parent
e7a6cba72c
commit
0a901fb7a6
2 changed files with 25 additions and 2 deletions
23
config.py
Normal file
23
config.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import requests
|
||||
import plistlib
|
||||
|
||||
#CONFIG_URL = "http://init-p01st.push.apple.com/bag"
|
||||
CONFIG_URL = "https://init.push.apple.com/bag"
|
||||
|
||||
def get_config():
|
||||
|
||||
r = requests.get(CONFIG_URL, verify=False)
|
||||
if r.status_code != 200:
|
||||
raise Exception("Failed to get config")
|
||||
|
||||
# Parse the config as a plist
|
||||
config = plistlib.loads(r.content)
|
||||
|
||||
# Parse the nested "bag" as a plist
|
||||
#config["bag"] = plistlib.loads(config["bag"])
|
||||
|
||||
return config
|
||||
|
||||
if __name__ == "__main__":
|
||||
config = get_config()
|
||||
print(config)
|
|
@ -4,8 +4,8 @@ import socket
|
|||
|
||||
COURIER_HOST = "10-courier.push.apple.com"
|
||||
COURIER_PORT = 5223
|
||||
#ALPN = [b"apns-security-v2"]
|
||||
ALPN = None
|
||||
ALPN = [b"apns-security-v2"]
|
||||
#ALPN = None
|
||||
|
||||
def connect(private_key=None, cert=None):
|
||||
# If we don't have a private key or certificate, generate one
|
||||
|
|
Loading…
Reference in a new issue