forked from chanjarster/weixin-java-tools
-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
java.security.KeyException
Binary(班纳睿) edited this page Oct 28, 2016
·
9 revisions
javax.net.ssl.SSLException: java.security.ProviderException: java.security.KeyException
一般出现此问题的原因是 使用了openjdk, 解决办法:
- 换成oracle jdk即可;
- 或者参考http://blog.csdn.net/yaominhua/article/details/51830630 (据说执行完后出现常见问题第一条,不建议使用此方法) 摘录如下:
解决方案
升级nss
sudo yum upgrade nss
String encType = request.getParameter("encrypt_type");
String nonce = request.getParameter("nonce");
String timestamp = request.getParameter("timestamp");
String msgSignature = request.getParameter("msg_signature");
String signature = request.getParameter("signature");
String openid = request.getParameter("openid");
log.info("接收微信请求:[openid=[{}], [openid=[{}],[signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[{}] ",
appid, openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
// 请求里面没有对应信息。 // if (!this.wxMpService.switchover(appid)) { //appid // throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); // }
if (!wxMpService.checkSignature(timestamp, nonce, signature)) {
throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
}
return ResponseEntity.ok("");