jdk/src/java.base/share/classes/javax/net/ssl/SSLSocket.java
changeset 45941 c864a5791b3a
parent 45118 e4258d800b54
child 46152 51d10b05c78e
equal deleted inserted replaced
45940:26225f034059 45941:c864a5791b3a
    30 import java.net.*;
    30 import java.net.*;
    31 import java.util.List;
    31 import java.util.List;
    32 import java.util.function.BiFunction;
    32 import java.util.function.BiFunction;
    33 
    33 
    34 /**
    34 /**
    35  * This class extends <code>Socket</code>s and provides secure
    35  * This class extends <code>Socket</code> and provides secure
    36  * socket using protocols such as the "Secure
    36  * sockets using protocols such as the "Secure
    37  * Sockets Layer" (SSL) or IETF "Transport Layer Security" (TLS) protocols.
    37  * Sockets Layer" (SSL) or IETF "Transport Layer Security" (TLS) protocols.
    38  * <P>
    38  * <P>
    39  * Such sockets are normal stream sockets, but they
    39  * Such sockets are normal stream sockets, but they
    40  * add a layer of security protections over the underlying network transport
    40  * add a layer of security protections over the underlying network transport
    41  * protocol, such as TCP.  Those protections include: <UL>
    41  * protocol, such as TCP.  Those protections include: <UL>
   103  * be enabled by default.
   103  * be enabled by default.
   104  * Only if both sides explicitly agree to unauthenticated and/or
   104  * Only if both sides explicitly agree to unauthenticated and/or
   105  * non-private (unencrypted) communications will such a ciphersuite be
   105  * non-private (unencrypted) communications will such a ciphersuite be
   106  * selected.
   106  * selected.
   107  *
   107  *
   108  * <P>When <code>SSLSocket</code>s are first created, no handshaking
   108  * <P>When an <code>SSLSocket</code> is first created, no handshaking
   109  * is done so that applications may first set their communication
   109  * is done so that applications may first set their communication
   110  * preferences:  what cipher suites to use, whether the socket should be
   110  * preferences:  what cipher suites to use, whether the socket should be
   111  * in client or server mode, etc.
   111  * in client or server mode, etc.
   112  * However, security is always provided by the time that application data
   112  * However, security is always provided by the time that application data
   113  * is sent over the connection.
   113  * is sent over the connection.
   116  * completion.  This involves
   116  * completion.  This involves
   117  * the use of two additional classes.  <em>HandshakeCompletedEvent</em>
   117  * the use of two additional classes.  <em>HandshakeCompletedEvent</em>
   118  * objects are passed to <em>HandshakeCompletedListener</em> instances,
   118  * objects are passed to <em>HandshakeCompletedListener</em> instances,
   119  * which are registered by users of this API.
   119  * which are registered by users of this API.
   120  *
   120  *
   121  * <code>SSLSocket</code>s are created by <code>SSLSocketFactory</code>s,
   121  * An <code>SSLSocket</code> is created by <code>SSLSocketFactory</code>,
   122  * or by <code>accept</code>ing a connection from a
   122  * or by <code>accept</code>ing a connection from a
   123  * <code>SSLServerSocket</code>.
   123  * <code>SSLServerSocket</code>.
   124  *
   124  *
   125  * <P>A SSL socket must choose to operate in the client or server mode.
   125  * <P>A SSL socket must choose to operate in the client or server mode.
   126  * This will determine who begins the handshaking process, as well
   126  * This will determine who begins the handshaking process, as well