在2018年6月18日之后连接到Maven Central/https://repo1.maven.org时,我遇到了上述错误.
我正在尝试与trackobot.com建立连接以接收一些JSON数据.服务器仅允许通过HTTPS/SSL进行连接.这是代码:
java.lang.System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
URL url = new URL("https://trackobot.com/profile/history.json?username=USER&token=TOCKEN");
InputStream is = url.openStream();
JsonParser parser = Json.createParser(is);
Run Code Online (Sandbox Code Playgroud)
openSteam抛出javax.net.ssl.SSLHandshakeException:收到致命警报:handshake_failure
我阅读了几篇与类似问题相关的帖子,但没有一个建议有帮助.相应的证书在我的信任库中.当我尝试连接到例如google.com时,没有错误.所以,问题似乎是在我试图连接的服务器的握手特定中.
我使用-Djavax.net.debug = ssl运行我的代码返回:
keyStore is :
keyStore type is : jks
keyStore provider is :
init keystore
init keymanager of type SunX509
trustStore is: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/security/cacerts
trustStore type is : jks
trustStore provider is :
init truststore
[Here I removed hundreds of „adding as trusted cert“:… lines]
trigger seeding of SecureRandom
done seeding SecureRandom
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: …Run Code Online (Sandbox Code Playgroud) 我已经用 java 1.8 安装了 tomcat 8(ssl 支持)。当启动tomcat catalina out 写
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.Handshaker.activate(Handshaker.java:503)
at sun.security.ssl.SSLEngineImpl.kickstartHandshake(SSLEngineImpl.java:729)
at sun.security.ssl.SSLEngineImpl.beginHandshake(SSLEngineImpl.java:756)
at org.apache.tomcat.util.net.SecureNioChannel.reset(SecureNioChannel.java:94)
at org.apache.tomcat.util.net.SecureNioChannel.<init>(SecureNioChannel.java:76)
at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:544)
at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:697)
at java.lang.Thread.run(Thread.java:745)
Run Code Online (Sandbox Code Playgroud)
和这个
12-Dec-2016 14:12:37.297 WARNING [main] org.apache.tomcat.util.net.jsse.JSSESocketFactory.getEnableableProtocols None of the SSL protocols specified are supported by the SSL engine : [TLSv1+TLSv1.1+TLSv1.2]
Run Code Online (Sandbox Code Playgroud)
使用旧版本的 tomcat 和 java 错误不会发生。
我的 server.xml 配置
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="700" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" sslEnabledProtocols="TLSv1+TLSv1.1+TLSv1.2"
keystoreFile="/var/lib/tomcat8/keystore" keystorePass="********" keystoreType="JKS"
keyAlias="tomcat" …Run Code Online (Sandbox Code Playgroud) 我通过https命中服务时看到以下错误。我尝试过如下更改Soap ui VM选项文件中的TLS版本:
-Dsoapui.https.protocols = TLSv1.0 -Dsoapui.https.protocols = TLSv1.2
也没有运气 请指教
Thu Sep 07 11:32:47 BST 2017:ERROR:javax.net.ssl.SSLException: Received fatal alert: protocol_version
javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at sun.security.ssl.AppOutputStream.write(Unknown Source)
at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:131)
at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:138)
at org.apache.http.impl.conn.LoggingSessionOutputBuffer.flush(LoggingSessionOutputBuffer.java:95)
at org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:270)
at org.apache.http.impl.AbstractHttpClientConnection.flush(AbstractHttpClientConnection.java:275)
at org.apache.http.impl.conn.AbstractClientConnAdapter.flush(AbstractClientConnAdapter.java:197)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:258)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doSendRequest(HttpClientSupport.java:119)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:233)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:323)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:297)
at …Run Code Online (Sandbox Code Playgroud) 我正在使用Apache HttpClient 4.3与hubic.com的API进行交互.我的最小可重复的例子只是一个班轮:
HttpClientBuilder.create().build().execute(new HttpGet("https://hubic.com"));
Run Code Online (Sandbox Code Playgroud)
然而,抛出:
Exception in thread "main" javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
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:1104)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:275)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:254)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:117)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
Run Code Online (Sandbox Code Playgroud)
如果我运行以下是输出System.setProperty("javax.net.debug", "all");:
trustStore is: /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts
trustStore type is : jks
trustStore provider is :
init truststore
adding as trusted cert: [... extremely large list ...] …Run Code Online (Sandbox Code Playgroud) 我的主机系统是Windows 10,我有cloudera vm,我的spark版本是1.6。我试图使用以下命令加载spark-shell。
spark-shell --packages org.apache.spark:spark-streaming-twitter_2.10:1.6.0
Run Code Online (Sandbox Code Playgroud)
但是它抛出以下异常:
:::: ERRORS Server access error at url https://repo1.maven.org/maven2/org/apache/spark/spark-streaming-twitter_2.10/1.6.0/spark-streaming-twitter_2.10-1.6.0.pom (javax.net.ssl.SSLException: Received fatal alert: protocol_version)
Server access error at url https://repo1.maven.org/maven2/org/apache/spark/spark-streaming-twitter_2.10/1.6.0/spark-streaming-twitter_2.10-1.6.0.jar (javax.net.ssl.SSLException: Received fatal alert: protocol_version)
Run Code Online (Sandbox Code Playgroud)
::使用详细或调试消息级别获取更多详细信息线程中的异常
"main" java.lang.RuntimeException: [unresolved dependency: org.apache.spark#spark-streaming-twitter_2.10;1.6.0: not found] at org.apache.spark.deploy.SparkSubmitUtils$.resolveMavenCoordinates(SparkSubmit.scala:1067) at org.apache.spark.deploy.SparkSubmit$.prepareSubmitEnvironment(SparkSubmit.scala:287) at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:154) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Run Code Online (Sandbox Code Playgroud)