我使用-djavax.net.debug=all
进行了一些进度调试。事实证明,在docker映像中运行时,通常的SSL握手只需要几个步骤:
Produced ClientHello handshake message
WRITE: TLS13 handshake, length = 2352
Raw write
Raw read (0000: 15 03 03 00 02 02 28 ......( )
READ: TLSv1.2 alert, length = 2
Received alert message (
"Alert": {
"level" : "fatal",
"description": "handshake_failure"
}
)
后面是SSLHandShakeException:
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:938)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:227)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1764)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1749)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1708)
at org.elasticsearch.client.SecurityClient.getSslCertificates(SecurityClient.java:508)
....
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Unknown Source)
at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl.decode(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl.readRecord(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl.unwrap(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl.unwrap(Unknown Source)
at java.base/javax.net.ssl.SSLEngine.unwrap(Unknown Source)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doUnwrap(SSLIOSession.java:271)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:316)
at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:509)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:120)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
从本地环境中运行时,握手看起来没有中断:
Produced ClientHello handshake message
WRITE: TLS13 handshake, length = 460
Raw write
Raw read
READ: TLSv1.2 handshake, length = 155
Consuming ServerHello
ServerHello
Negotiated protocol version: TLSv1.3
Session initialized: Session(1560119025211|TLS_AES_256_GCM_SHA384)
WRITE: TLS13 change_cipher_spec, length = 1
Raw write
Raw read
READ: TLSv1.2 change_cipher_spec, length = 1
Consuming ChangeCipherSpec message
Raw read
READ: TLSv1.2 application_data, length = 27
...
Raw read
READ: TLSv1.2 application_data, length = 8469
Consuming server Certificate handshake message
... // here is the list of 3 certificates with "SHA256withRSA", "SHA256withRSA", "SHA1withRSA" signature algorithms
Found trusted certificate ⇢ SHA1withRSA
...
TLDR:在应用程序中为客户端强制TLSV1.2使握手从docker内部完成
经过多次尝试/失败后,我使它起作用了。以下事情并没有什么不同:
com.sun.net.ssl.enableecc=false
https.protocols
和/或jdk.tls.client.protocols
https.protocols
问题内容: 我使用Docker Compose运行了一个简单的Elasticsearch实例: 我可以使用localhost从浏览器访问它,但是当我运行我的应用程序并连接到它时,遇到了一些问题。从我能够跟踪到的内容来看,应用程序似乎成功连接到Elasticsearch实例,然后解析了它绑定的IP,然后使用该IP地址与Elasticsearch实例进行通信。 来自Fiddler: http://10
问题内容: 我有这个课: 有什么方法可以使用自变量访问静态变量?我宁愿这样做,因为长名称不可读。 问题答案: 使用。这对新旧样式类均适用。
我试图在不运行的情况下访问一个docker映像,我只想知道它包含什么以进行验证。我不能ssh到容器中,因为它只需要一秒钟就结束了,所以我需要探索图像而不是容器。或者在容器完成之前是否有访问容器的权限?
问题内容: 我在网上商店应用程序中有一个Orders模型,它具有一个自动递增的主键和一个自身的外键,因为可以将订单分为多个订单,但是必须保持与原始订单的关系。 我已经为管理站点注册了OrderAdmin类。对于详细视图,我已包含在属性中。当然,默认情况下,这会在选择框中列出所有订单,但这不是所需的行为。相反,对于没有父订单的订单(即未与其他订单拆分;为NULL /无)的订单不应该显示。对于已拆分的
我有两个码头集装箱。一个是基于标准的MariaDB图像。这个容器被命名为“mariadb”,里面有一个叫做“fi”的数据库。fi db内部有几个表,每个表都有几行数据。使用DataGrip或任何其他数据库查看软件,我可以成功地访问和查询这个数据库,并使用端口3306在本地主机上调用它。 按照下面的建议对连接字符串进行了更改,如上图所示。现在使用命令“run-i-p8080:8080--link m
我使用的Java调用是: