java tsl_java 关于TLS的Renegotiation说明

A security vulnerability in all versions of the Transport Layer Security (TLS) protocol (including the older Secure Socket Layer (SSLv3)) can allow Man-In-The-Middle (MITM) type attacks where chosen plain text is injected as a prefix to a TLS connection. This vulnerability does not allow an attacker to decrypt or modify the intercepted network communication once the client and server have successfully negotiated a session between themselves. This vulnerability has been disclosed at:

This release includes an interim fix that disables TLS/SSL renegotiation in the Java Secure Sockets Extension (JSSE) by default. This issue primarily affects the server side of a connection, so this fix should be deployed on the server side, but can also be deployed to the client side if so desired.

Applications that require TLS/SSL renegotiation will be impacted. (For example, web servers that initially allow for anonymous client browsing, but later require TLS/SSL authenticated clients on the same connection.) With this fix, applications will not be able to initiate TLS/SSL renegotiation, and will reject all peer-initiated TLS/SSL renegotiation requests.

Applications attempting to initiate renegotiation (via SSLSocket.startHandshake() or SSLEngine.beginHandshake()) will receive a SSLHandshakeException (IOException) and the connection will be shutdown.

Applications that receive a renegotiation request from the peer will respond according to the type of connection in place:TLSv1: A warning Alert message of type "no_renegotiation(100)" will be sent to the peer and the connection will remain open.

SSLv3: The application will receive a SSLHandshakeException, and the connection will be closed. ("no_renegotiation" is not defined in the SSLv3 spec.)

Renegotiations can be re-enabled for those applications that need it by setting the new system property sun.security.ssl.allowUnsafeRenegotiation to true before the JSSE library is initialized. There are several ways to set this property:Command Line:% java -Dsun.security.ssl.allowUnsafeRenegotiation=true Main

Java Control Panel (Java Plug-in / Java Web Start) - Runtime Environment.

Within the application:java.lang.System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", true);

Note that TLS/SSL renegotiation will not occur unless both client and server have enabled renegotiations.

WARNING: It is risky to re-enable TLS/SSL renegotiation, as the vulnerability is once again present.

The IETF has recently issued RFC 5746 to address this problem. Oracle will update this interim fix with the industry-approved fix in the next Java SE and Java for Business security updates.

If one chooses to disable this interim fix but still wishes to "disable" renegotiations, one can invalidate current sessions (SSLSession.invalidate()), then call SSLSocket.setEnableSessionCreation(false) orSSLEngine.setEnableSessionCreation(false). This approach still allows renegotiations to occur, but since only existing valid sessions can be resumed, there are no valid sessions to resume, and new sessions can't be created, renegotiations will necessarily fail.

A side effect of this approach is that sessions can't be resumed on later connections, thus each new connection must do a complete handshake from scratch. That is, abbreviated handshakes on later connections are not possible.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值