我试图使用Python向iPhone发送推送通知。我已经导出我的证书和私钥成从钥匙串访问P12文件,然后使用以下命令转换成PEM文件:使用Python连接到iPhone的APNS
openssl pkcs12 -in cred.p12 -out cert.pem -nodes -clcerts
我使用APNSWrapper在Python进行连接。
我运行下面的代码:
deviceToken = 'Qun\xaa\xd ... c0\x9c\xf6\xca' # create wrapper wrapper = APNSNotificationWrapper('/path/to/cert/cert.pem', True) # create message message = APNSNotification() message.token(deviceToken) message.badge(5) # add message to tuple and send it to APNS server wrapper.append(message) wrapper.notify()
然后我得到的错误信息:
ssl.SSLError: (1, '_ssl.c:485: error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown')
谁能帮我这个?
那么问题是什么?证书或服务? – JackLeo 2011-04-13 14:32:41