public class ResumingClientHandshaker extends ClientHandshaker
Client Server ------ ------ ClientHello --------> Flight 1 ServerHello \ [ChangeCipherSpec] Flight 2 <-------- Finished / [ChangeCipherSpec] \Flight 3 Finished --------> /If the server denies to resume the session with the provided session id, the handshaker falls back to a full-handshake, depicted in Figure 1, see
ClientHandshaker
.
This implementation offers a probing mode. If a mobile peer doesn't get a ACK or response that may have two different causes:
The second is sometime hard to detect; the peer's state is connected, but effectively it's not working. In that case, after some retransmissions, the peer starts a handshake. Without the probing mode starting a handshake removes on the client the session. If the handshake timesout (though the connection is not working), the peer still requires a new handshake after the connectivity is established again. With probing mode, the handshake starts without removing the session. If some data is received, the session is removed and the handshake gets completed. If no data is received, the peer assumes, that the connectivity is lost (even if it's own state indicates connectivity) and just timesout the request. If the connectivity is established again, just a new request could be send without a handshake.
clientHello, flight5, handshakeHash, INIT, maxFragmentLengthCode, SEVER_CERTIFICATE, supportedClientCertificateTypes, supportedGroups, supportedServerCertificateTypes, supportedSignatureAlgorithms, truncateCertificatePath
advancedPskStore, certificateChain, certificateIdentityAvailable, certificateIdentityProvider, certificateVerifier, clientRandom, connectionIdGenerator, extendedMasterSecretMode, flightNumber, handshakeMessages, LOGGER, otherPeersCertificateVerified, otherPeersPublicKey, peerToLog, privateKey, publicKey, recordSizeLimit, serverRandom, sniEnabled, useTruncatedCertificatePathForVerification
Constructor and Description |
---|
ResumingClientHandshaker(DTLSSession session,
RecordLayer recordLayer,
ScheduledExecutorService timer,
Connection connection,
DtlsConnectorConfig config,
boolean probe)
Creates a new handshaker for resuming an existing session with a server.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doProcessMessage(HandshakeMessage message)
Does the specific processing of a message received from a peer in
the course of an ongoing handshake.
|
protected void |
receivedServerHello(ServerHello message)
Check, if the server want an abbreviated or full handshake.
|
void |
startHandshake() |
addConnectionId, addMaxFragmentLength, addRecordSizeLimit, addServerNameIndication, completeProcessingServerHelloDone, getPskClientIdentity, isClient, isProbing, isRemovingConnection, isSupportedCertificateType, processCertificateIdentityAvailable, processCertificateVerified, processMasterSecret, receivedHelloVerifyRequest, resetProbing, verifyServerHelloExtensions
addApplicationDataForDeferredProcessing, addRecordsOfNextEpochForDeferredProcessing, addSessionListener, applyMasterSecret, calculateKeys, cloneMessageDigest, completePendingFlight, contextEstablished, createFinishedMessage, createFlight, destroy, ensureUndestroyed, expectChangeCipherSpecMessage, expectEcc, expectMessage, generateMasterSecretSeed, getClientRandom, getConnection, getDtlsContext, getFailureCause, getHandshakeMessageDigest, getPeerAddress, getReadConnectionId, getServerNames, getServerRandom, getSession, handshakeAborted, handshakeCompleted, handshakeFailed, handshakeFlightRetransmitted, handshakeStarted, hasContextEstablished, hasMasterSecret, hasPendingApiCall, isChangeCipherSpecMessageExpected, isDestroyed, isExpectedStates, isExpired, isInboundMessageProcessed, isPskRequestPending, processAsyncHandshakeResult, processCertificateIdentityResult, processCertificateVerificationResult, processMessage, processPskSecretResult, reassembleFragment, removeSessionListener, requestCertificateIdentity, requestPskSecretResult, resumeMasterSecret, sendFlight, sendLastFlight, setCurrentReadState, setCurrentWriteState, setCustomArgument, setExpectedStates, setFailureCause, setGenerateClusterMacKeys, setOtherPeersSignatureVerified, supportsConnectionId, takeDeferredApplicationData, takeDeferredApplicationData, takeDeferredRecordsOfNextEpoch, verifyCertificate, verifyFinished, wrapMessage, wrapMessage
public ResumingClientHandshaker(DTLSSession session, RecordLayer recordLayer, ScheduledExecutorService timer, Connection connection, DtlsConnectorConfig config, boolean probe)
session
- the session to resume.recordLayer
- the object to use for sending flights to the peer.timer
- scheduled executor for flight retransmission (since 2.4).connection
- the connection related with the session.config
- the DTLS configuration parameters to use for the handshake.probe
- true
enable probing for this resumption handshake,
false
, not probing handshake.IllegalArgumentException
- if the given session does not contain an identifier.NullPointerException
- if any of the provided parameter is
null
protected void doProcessMessage(HandshakeMessage message) throws HandshakeException
Handshaker
doProcessMessage
in class ClientHandshaker
message
- the message received from the peerHandshakeException
- if the handshake message cannot be processed properlyprotected void receivedServerHello(ServerHello message) throws HandshakeException
receivedServerHello
in class ClientHandshaker
message
- the ServerHello
message.HandshakeException
- if the ServerHello message cannot be
processed, e.g. because the server selected an unknown or
unsupported cipher suitepublic void startHandshake() throws HandshakeException
startHandshake
in class ClientHandshaker
HandshakeException
Copyright © 2021 Eclipse Foundation. All rights reserved.