当前位置: 首页 > 知识库问答 >
问题:

尝试访问AWS服务时不支持的记录版本未知-0.0例外

陆甫
2023-03-14

在尝试访问AWS服务时,我收到以下证书错误。我在Jetty服务器上运行这个。

我用同样的设置创建了另一个hello world项目,它似乎工作正常?

为什么我突然得到了javax。网ssl。SSLexException:不支持的记录版本未知-0.0例外?

[java] software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: Unsupported record version Unknown-0.0
 [java]     at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:97)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.handleThrownException(RetryableStage.java:136)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.execute(RetryableStage.java:94)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:62)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:42)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
 [java]     at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:57)
 [java]     at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:37)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
 [java]     at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
 [java]     at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:240)
 [java]     at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:96)
 [java]     at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:120)
 [java]     at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:73)
 [java]     at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:44)
 [java]     at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:55)
 [java]     at software.amazon.codeguruprofilerjavaagent.sdkclientcopy.DefaultCodeGuruProfilerClient.configureAgent(DefaultCodeGuruProfilerClient.java:137)
 [java]     at software.amazon.codeguruprofilerjavaagent.CodeGuruProfilerSDKClient.configureAgent(CodeGuruProfilerSDKClient.java:55)
 [java]     at software.amazon.codeguruprofilerjavaagent.ProfilingCommand.refreshConfiguration(ProfilingCommand.java:246)
 [java]     at software.amazon.codeguruprofilerjavaagent.ProfilingCommand.runProfiler(ProfilingCommand.java:210)
 [java]     at software.amazon.codeguruprofilerjavaagent.Timer.time(Timer.java:69)
 [java]     at software.amazon.codeguruprofilerjavaagent.ProfilingCommand.run(ProfilingCommand.java:195)
 [java]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 [java]     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
 [java]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
 [java]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
 [java]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 [java]     at java.lang.Thread.run(Thread.java:748)
 [java] Caused by: javax.net.ssl.SSLException: Unsupported record version Unknown-0.0
 [java]     at sun.security.ssl.InputRecord.checkRecordVersion(InputRecord.java:552)
 [java]     at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:565)
 [java]     at sun.security.ssl.InputRecord.read(InputRecord.java:529)
 [java]     at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
 [java]     at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
 [java]     at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
 [java]     at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
 [java]     at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
 [java]     at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
 [java]     at software.amazon.awssdk.http.apache.internal.conn.SdkTlsSocketFactory.connectSocket(SdkTlsSocketFactory.java:113)
 [java]     at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
 [java]     at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
 [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

共有2个答案

华展鹏
2023-03-14

>

  • 从tomcat启动脚本中删除此语句后,它就工作了。setJAVA_OPTS=%JAVA_OPTS%-Djsse.enableSNIExent=false

    不是删除上面的语句,而是在下面添加了“它起作用”语句。设置JAVA\u OPTS=%JAVA\u OPTS%-Dhttps。协议=SSLv3、TLSv1、TLSv1。1,TLSv1。2.

  • 方夜洛
    2023-03-14

    原来这是在我们的代码库中设置的,删除它解决了问题

    System.setProperty("jsse.enableSNIExtension", "false")
    

    把线移开,你会没事的。

     类似资料: