method:getApplicationProtocol() [ADDED]

  • getApplicationProtocol

    public String getApplicationProtocol()
    
    Returns the most recent application protocol value negotiated for this connection.

    If supported by the underlying SSL/TLS/DTLS implementation, application name negotiation mechanisms such as RFC 7301 , the Application-Layer Protocol Negotiation (ALPN), can negotiate application-level values between peers.

    Implementation Requirements:
    The implementation in this class throws UnsupportedOperationException and performs no other action.
    Returns:
    null if it has not yet been determined if application protocols might be used for this connection, an empty String if application protocols values will not be used, or a non-empty application protocol String if a value was successfully negotiated.
    Throws:
    UnsupportedOperationException - if the underlying provider does not implement the operation.
    Since:
    8

method:getHandshakeApplicationProtocol() [ADDED]

  • getHandshakeApplicationProtocol

    public String getHandshakeApplicationProtocol()
    
    Returns the application protocol value negotiated on a SSL/TLS handshake currently in progress.

    Like getHandshakeSession(), a connection may be in the middle of a handshake. The application protocol may or may not yet be available.

    Implementation Requirements:
    The implementation in this class throws UnsupportedOperationException and performs no other action.
    Returns:
    null if it has not yet been determined if application protocols might be used for this handshake, an empty String if application protocols values will not be used, or a non-empty application protocol String if a value was successfully negotiated.
    Throws:
    UnsupportedOperationException - if the underlying provider does not implement the operation.
    Since:
    8

method:setHandshakeApplicationProtocolSelector(java.util.function.BiFunction) [ADDED]

  • setHandshakeApplicationProtocolSelector

    public void setHandshakeApplicationProtocolSelector(BiFunction<SSLEngine,List<String>,String> selector)
    
    Registers a callback function that selects an application protocol value for a SSL/TLS/DTLS handshake. The function overrides any values supplied using SSLParameters.setApplicationProtocols and it supports the following type parameters:
    SSLEngine
    The function's first argument allows the current SSLEngine to be inspected, including the handshake session and configuration settings.
    List<String>
    The function's second argument lists the application protocol names advertised by the TLS peer.
    String
    The function's result is an application protocol name, or null to indicate that none of the advertised names are acceptable. If the return value is an empty String then application protocol indications will not be used. If the return value is null (no value chosen) or is a value that was not advertised by the peer, the underlying protocol will determine what action to take. (For example, ALPN will send a "no_application_protocol" alert and terminate the connection.)
    For example, the following call registers a callback function that examines the TLS handshake parameters and selects an application protocol name:
    
         serverEngine.setHandshakeApplicationProtocolSelector(
             (serverEngine, clientProtocols) -> {
                 SSLSession session = serverEngine.getHandshakeSession();
                 return chooseApplicationProtocol(
                     serverEngine,
                     clientProtocols,
                     session.getProtocol(),
                     session.getCipherSuite());
             });
     
    
    API Note:
    This method should be called by TLS server applications before the TLS handshake begins. Also, this SSLEngine should be configured with parameters that are compatible with the application protocol selected by the callback function. For example, enabling a poor choice of cipher suites could result in no suitable application protocol. See SSLParameters.
    Implementation Requirements:
    The implementation in this class throws UnsupportedOperationException and performs no other action.
    Parameters:
    selector - the callback function, or null to disable the callback functionality.
    Throws:
    UnsupportedOperationException - if the underlying provider does not implement the operation.
    Since:
    8

method:getHandshakeApplicationProtocolSelector() [ADDED]

  • getHandshakeApplicationProtocolSelector

    public BiFunction<SSLEngine,List<String>,String> getHandshakeApplicationProtocolSelector()
    
    Retrieves the callback function that selects an application protocol value during a SSL/TLS/DTLS handshake. See setHandshakeApplicationProtocolSelector for the function's type parameters.
    Implementation Requirements:
    The implementation in this class throws UnsupportedOperationException and performs no other action.
    Returns:
    the callback function, or null if none has been set.
    Throws:
    UnsupportedOperationException - if the underlying provider does not implement the operation.
    Since:
    8

© 2019 Oracle Corporation and/or its affiliates