mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8207250: setUseClientMode post handshake with the same value as before does not throw IAE
Reviewed-by: xuelei
This commit is contained in:
parent
8818f46285
commit
a825fe0a2d
2 changed files with 20 additions and 16 deletions
|
@ -393,6 +393,13 @@ class TransportContext implements ConnectionContext, Closeable {
|
|||
}
|
||||
|
||||
void setUseClientMode(boolean useClientMode) {
|
||||
// Once handshaking has begun, the mode can not be reset for the
|
||||
// life of this engine.
|
||||
if (handshakeContext != null || isNegotiated) {
|
||||
throw new IllegalArgumentException(
|
||||
"Cannot change mode after SSL traffic has started");
|
||||
}
|
||||
|
||||
/*
|
||||
* If we need to change the client mode and the enabled
|
||||
* protocols and cipher suites haven't specifically been
|
||||
|
@ -400,13 +407,6 @@ class TransportContext implements ConnectionContext, Closeable {
|
|||
* default ones.
|
||||
*/
|
||||
if (sslConfig.isClientMode != useClientMode) {
|
||||
// Once handshaking has begun, the mode can not be reset for the
|
||||
// life of this engine.
|
||||
if (handshakeContext != null || isNegotiated) {
|
||||
throw new IllegalArgumentException(
|
||||
"Cannot change mode after SSL traffic has started");
|
||||
}
|
||||
|
||||
if (sslContext.isDefaultProtocolVesions(
|
||||
sslConfig.enabledProtocols)) {
|
||||
sslConfig.enabledProtocols =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue