/** * Called when the client received the server's finished message. If the data can be verified, * encrypted application data can be sent. * * @param message the {@link Finished} message. * @return the list * @throws HandshakeException */ private DTLSFlight receivedServerFinished(Finished message) throws HandshakeException { DTLSFlight flight = new DTLSFlight(); message.verifyData(getMasterSecret(), false, handshakeHash); state = HandshakeType.FINISHED.getCode(); session.setActive(true); // received server's Finished message, now able to send encrypted // message ApplicationMessage applicationMessage = new ApplicationMessage(this.message.getBytes()); flight.addMessage(wrapMessage(applicationMessage)); // application data is not retransmitted flight.setRetransmissionNeeded(false); return flight; }