开发者社区> 问答> 正文

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

阿里云服务上获取微信token报错
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:421)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:641)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at com.infoq.raven.wechat.util.HttpUtils.sendGet(HttpUtils.java:75)
at com.infoq.raven.wechat.service.WeChatService.getAccessToken(WeChatService.java:39)
at com.infoq.raven.wechat.config.Quartz.getWeChatToken(Quartz.java:23)
at com.infoq.raven.configuration.initServiceServlet.checkQuartz(initServiceServlet.java:34)
at com.infoq.raven.configuration.initServiceServlet.init(initServiceServlet.java:26)
at com.infoq.raven.configuration.initServiceServlet.run(initServiceServlet.java:21)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:784)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:771)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
at com.infoq.raven.Application.main(Application.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:104)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:61)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)

展开
收起
guodddaaa 2016-11-07 00:14:02 7648 0
2 条回答
写回答
取消 提交回答
  • 你这个报错应该是ssl握手中校验证书那步出错,也就是说你这个证书是不被信任的或者非权威的证书机构颁发的,如果你可以接受这种不安全的请求的话,你可以选择忽略证书校验,具体的做法是你在创建httpclient的时候创建一个SSLSocketFactory然后指定是ALLOW_ALL_HOSTNAME_VERIFIER的就可以了。
    可参考这个
    http://www.iteye.com/problems/59109

    2019-07-17 20:23:14
    赞同 展开评论 打赏
  • 码农|Coder| Pythonista

    根据提示,可能是Ssl解析出了问题。关闭Ssl检查试试?

    2019-07-17 20:23:14
    赞同 展开评论 打赏
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载