Skip to content

Commit 6c52b73

Browse files
committed
8209992: Align SSLSocket and SSLEngine Javadocs
Reviewed-by: wetmore
1 parent 567c0c9 commit 6c52b73

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

src/java.base/share/classes/javax/net/ssl/SSLEngine.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,17 @@ public SSLSession getHandshakeSession() {
10881088

10891089

10901090
/**
1091-
* Initiates handshaking (initial or renegotiation) on this SSLEngine.
1091+
* Begins handshaking on this {@code SSLEngine}.
1092+
* <P>
1093+
* Common reasons include a need to initiate a new protected session,
1094+
* create new encryption keys, or to change cipher suites. To force
1095+
* complete reauthentication, the current session should be invalidated
1096+
* before starting this handshake.
1097+
* <P>
1098+
* The behavior of this method is protocol (and possibly implementation)
1099+
* dependent. For example, in TLSv1.3 calling this method after the
1100+
* connection has been established will force a key update. For prior TLS
1101+
* versions it will force a renegotiation (re-handshake).
10921102
* <P>
10931103
* This method is not needed for the initial handshake, as the
10941104
* {@code wrap()} and {@code unwrap()} methods will
@@ -1102,9 +1112,6 @@ public SSLSession getHandshakeSession() {
11021112
* SSLSocket#startHandshake()} method, this method does not block
11031113
* until handshaking is completed.
11041114
* <P>
1105-
* To force a complete SSL/TLS/DTLS session renegotiation, the current
1106-
* session should be invalidated prior to calling this method.
1107-
* <P>
11081115
* Some protocols may not support multiple handshakes on an existing
11091116
* engine and may throw an {@code SSLException}.
11101117
*

src/java.base/share/classes/javax/net/ssl/SSLSocket.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,19 +502,26 @@ public abstract void removeHandshakeCompletedListener(
502502

503503

504504
/**
505-
* Starts an SSL handshake on this connection. Common reasons include
506-
* a need to use new encryption keys, to change cipher suites, or to
507-
* initiate a new session. To force complete reauthentication, the
508-
* current session could be invalidated before starting this handshake.
509-
*
510-
* <P> If data has already been sent on the connection, it continues
505+
* Starts handshaking on this {@code SSLSocket}.
506+
* <P>
507+
* Common reasons include a need to initiate a new protected session,
508+
* create new encryption keys, or to change cipher suites. To force
509+
* complete reauthentication, the current session should be invalidated
510+
* before starting this handshake.
511+
* <P>
512+
* The behavior of this method is protocol (and possibly implementation)
513+
* dependent. For example, in TLSv1.3 calling this method after the
514+
* connection has been established will force a key update. For prior TLS
515+
* versions it will force a renegotiation (re-handshake).
516+
* <P>
517+
* If data has already been sent on the connection, it continues
511518
* to flow during this handshake. When the handshake completes, this
512519
* will be signaled with an event.
513-
*
520+
* <P>
514521
* This method is synchronous for the initial handshake on a connection
515522
* and returns when the negotiated handshake is complete. Some
516523
* protocols may not support multiple handshakes on an existing socket
517-
* and may throw an IOException.
524+
* and may throw an {@code IOException}.
518525
*
519526
* @throws IOException on a network level error
520527
* @see #addHandshakeCompletedListener(HandshakeCompletedListener)

0 commit comments

Comments
 (0)