当前位置:   article > 正文

java hutool 调用https请求 cn.hutool.core.io.IORuntimeException: SSLException: Received fatal alert: inte

cn.hutool.core

java调用hutool工具类中的createPost方法,出错:

cn.hutool.core.io.IORuntimeException: SSLException: Received fatal alert: internal_error

jdk版本:1.8.0.131

报错如下

  1. cn.hutool.core.io.IORuntimeException: SSLException: Received fatal alert: internal_error
  2. at cn.hutool.http.HttpRequest.send(HttpRequest.java:1231)
  3. at cn.hutool.http.HttpRequest.doExecute(HttpRequest.java:1113)
  4. at cn.hutool.http.HttpRequest.execute(HttpRequest.java:1004)
  5. at cn.hutool.http.HttpRequest.execute(HttpRequest.java:980)
  6. at com.nft.web.controller.nft.NftTestController.testbycode(NftTestController.java:255)
  7. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  8. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  9. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  10. at java.lang.reflect.Method.invoke(Method.java:498)
  11. at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
  12. at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
  13. at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
  14. at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:898)
  15. at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:809)
  16. at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
  17. at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)
  18. at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
  19. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
  20. at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
  21. at javax.servlet.http.HttpServlet.service(HttpServlet.java:645)
  22. at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
  23. at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
  24. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
  25. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  26. at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
  27. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  28. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  29. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:111)
  30. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  31. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  32. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:111)
  33. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  34. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  35. at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:114)
  36. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  37. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  38. at com.nft.common.filter.RepeatableFilter.doFilter(RepeatableFilter.java:39)
  39. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  40. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  41. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
  42. at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
  43. at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
  44. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  45. at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121)
  46. at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
  47. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  48. at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
  49. at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
  50. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  51. at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105)
  52. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  53. at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
  54. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  55. at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
  56. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  57. at com.nft.framework.security.filter.JwtAuthenticationTokenFilter.doFilterInternal(JwtAuthenticationTokenFilter.java:50)
  58. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  59. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  60. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:111)
  61. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  62. at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
  63. at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
  64. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  65. at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
  66. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  67. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  68. at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
  69. at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
  70. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  71. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  72. at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
  73. at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
  74. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  75. at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
  76. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  77. at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
  78. at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
  79. at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
  80. at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
  81. at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
  82. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  83. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  84. at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
  85. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  86. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  87. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  88. at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
  89. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  90. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  91. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  92. at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
  93. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  94. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
  95. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
  96. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
  97. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
  98. at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
  99. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
  100. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
  101. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
  102. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
  103. at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
  104. at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
  105. at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
  106. at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
  107. at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
  108. at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
  109. at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
  110. at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  111. at java.lang.Thread.run(Thread.java:748)
  112. Caused by: javax.net.ssl.SSLException: Received fatal alert: internal_error
  113. at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
  114. at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
  115. at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)
  116. at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
  117. at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
  118. at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
  119. at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
  120. at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
  121. at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
  122. at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316)
  123. at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291)
  124. at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
  125. at cn.hutool.http.HttpConnection.getOutputStream(HttpConnection.java:449)
  126. at cn.hutool.http.HttpRequest.sendFormUrlEncoded(HttpRequest.java:1254)
  127. at cn.hutool.http.HttpRequest.send(HttpRequest.java:1223)
  128. ... 109 common frames omitted

找了一圈资料都没用,找的资料也贴出来                        
原文链接:https://blog.csdn.net/xiao__jia__jia/article/details/123752327

终极解决方案: 升级jdk版本, 由1.8.0.131 升级至 1.8.0.412 完美解决

linux在线升级步骤:

第一步:yum查看可用jdk版本

yum  list | grep jdk   

第二步:安装升级

yum install java-1.8.0-openjdk.x86_64

等jdk更新完,重启java服务,再试试接口调用

补充一句: 如果用xsehll 链接linux窗口,需要关闭窗口重新打开,java -version 才会生效

Over~~ ,完美解决。回见了您内

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/989757
推荐阅读
相关标签
  

闽ICP备14008679号