Java APNS证书错误,“DerInputStream.getLength():lengthTag = 109,太大了。” [英] Java APNS Certificate Error with "DerInputStream.getLength(): lengthTag=109, too big."

查看:460
本文介绍了Java APNS证书错误,“DerInputStream.getLength():lengthTag = 109,太大了。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用java APNS将推送通知发送到iOS时,我收到以下错误消息:

When I try to using java APNS to send the push notification to iOS, I got this error message:

com.notnoop.exceptions.InvalidSSLConfig: java.io.IOException:DerInputStream.getLength():lengthTag = 109,太大。

我已经尝试将证书转换为个人信息交换(。 p12)也得到了同样的错误。任何人都知道问题以及如何解决它?

I already try converting the certificate to Personal Information Exchange (.p12) also getting the same error. Anyone know to problem and how to resolve it?

这是我的java代码:

ApnsService service =
    APNS.newService()
   .withCert("src/net/notification/ck.jks", "******")
   .withSandboxDestination()
   .build();

String payload = APNS.newPayload().alertBody(record.getSendMsg()).build();
String token = record.getToken();
service.push(token, payload);

谢谢。

推荐答案

这是因为系统认为您正在尝试读取不同类型的密钥库而不是JKS。您需要指定该文件是JKS或将其转换为其他格式。

This occurs because the system thinks you are trying to read a different type of keystore and not JKS. You will need to specify that the file is JKS or convert it to the other format.

我看到您已尝试转换为.p12。如果您正确执行此操作,可能还有其他一些默认格式。我建议找出如何指定JKS。

I see that you have already tried converting to .p12. If you did this correctly, perhaps there is some other default format. I recommend finding out how to specify JKS instead.

这篇关于Java APNS证书错误,“DerInputStream.getLength():lengthTag = 109,太大了。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆