开发者社区> 问答> 正文

问题handshakeFailure 错误 ssl证书问题

求助: 从阿里云服务器迁移之后,服务器端发请求AccessToken 报错


获取AccessToken的方法时
oapi.dingtalk.com/gettoken?corpid=id&corpsecret=secrect


异常信息:


javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
        at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1991)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1098)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)      
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)        
       at jodd.http.net.SocketHttpConnectionProvider.create HttpConnection(SocketHttpConnectionProvider.java:43)
        at jodd.http.HttpRequest.open(HttpRequest.java:561)        
       at jodd.http.HttpRequest.open(HttpRequest.java:548)
        at jodd.http.HttpRequest.send(HttpRequest.java:639)        
       at pk.api.op.dd.DdCorpApi.doGet(DdCorpApi.java:45)
        at pk.api.op.dd.DdCorpApi.getAccessToken(DdCorpApi.java:107)      
       at pk.api.op.dd.DdCorpApi.getAccessToken(DdCorpApi.java:74)
        at pk.api.op.dd.DdCorpApi.getJsapiTicket(DdCorpApi.java:136)        
       at pk.api.en.dd.DdController.js_config(DdController.java:56)
        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 com.jfinal.aop.Invocation.invoke(Invocation.java:73)      
       at pk.api.mt.auth.MtAuthInterceptor.intercept(MtAuthInterceptor.java:19)
        at com.jfinal.aop.Invocation.invoke(Invocation.java:67)    
       at pk.api.ag.user.role.AgRoleInterceptor.intercept(AgRoleInterceptor.java:21)
        at com.jfinal.aop.Invocation.invoke(Invocation.java:67)



看到博客说需要用阿里的负载均衡申请ssl证书安装,迁移过来的环境并未使用阿里云服务器,也没有使用slb,


然后之前使用阿里云服务器并没有要安装证书或者其他配置什么的

展开
收起
jaso 2016-06-02 23:26:10 6288 0
3 条回答
写回答
取消 提交回答
  • 好的
    2016-06-13 20:27:42
    赞同 展开评论 打赏
  • Re问题handshakeFailure 错误 ssl证书问题
    问题已经解决了,之前用的openJdk,换成官方jdk就ok了
    2016-06-13 18:56:39
    赞同 展开评论 打赏
  • Re问题handshakeFailure 错误 ssl证书问题
    连接服务器跳过ssl验证即可
    SSLContext sc = SSLContext.getInstance("TLS");  
             sc.init(null, new TrustManager[]{new MyTrustManager()}, new SecureRandom());  
             HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());  
             HttpsURLConnection.setDefaultHostnameVerifier(new MyHostnameVerifier());  
             HttpsURLConnection conn = (HttpsURLConnection)new URL(https).openConnection();
    https为URL
    2016-06-03 14:29:54
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

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

相关实验场景

更多