fixed #90 Support load p12 format of certificate file.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-06-12 15:54:17 +08:00
parent 27445087b4
commit 146854e381
2 changed files with 17 additions and 3 deletions

View File

@@ -427,7 +427,7 @@ func TestDisabledIosNotifications(t *testing.T) {
assert.Equal(t, 2, count)
}
func TestMissingIosCertificate(t *testing.T) {
func TestWrongIosCertificateExt(t *testing.T) {
PushConf = config.BuildDefaultPushConf()
PushConf.Ios.Enabled = true
@@ -435,13 +435,14 @@ func TestMissingIosCertificate(t *testing.T) {
err := InitAPNSClient()
assert.Error(t, err)
assert.Equal(t, "Wrong Certificate key extension.", err.Error())
}
func TestAPNSClientDevHost(t *testing.T) {
PushConf = config.BuildDefaultPushConf()
PushConf.Ios.Enabled = true
PushConf.Ios.PemPath = "../certificate/certificate-valid.pem"
PushConf.Ios.PemPath = "../certificate/certificate-valid.p12"
InitAPNSClient()
assert.Equal(t, apns2.HostDevelopment, ApnsClient.Host)