ChangeCipherSpecHandler extends ProtocolMessageHandler<ChangeCipherSpecMessage> { @Override public void adjustTLSContext(ChangeCipherSpecMessage message) { if (tlsContext.getTalkingConnectionEndType() != tlsContext.getChooser().getConnectionEndType() && tlsContext.getChooser().getSelectedProtocolVersion() != ProtocolVersion.TLS13) { tlsContext.getRecordLayer().updateDecryptionCipher(); tlsContext.setReadSequenceNumber(0); tlsContext.getRecordLayer().updateDecompressor(); tlsContext.increaseDtlsReadEpoch(); } } ChangeCipherSpecHandler(TlsContext tlsContext); @Override ChangeCipherSpecParser getParser(byte[] message, int pointer); @Override ChangeCipherSpecPreparator getPreparator(ChangeCipherSpecMessage message); @Override ChangeCipherSpecSerializer getSerializer(ChangeCipherSpecMessage message); @Override void adjustTLSContext(ChangeCipherSpecMessage message); @Override void adjustTlsContextAfterSerialize(ChangeCipherSpecMessage message);  }
@Test public void testAdjustTLSContext() { ChangeCipherSpecMessage message = new ChangeCipherSpecMessage(); context.setRecordLayer(new TlsRecordLayer(context)); context.setSelectedCipherSuite(CipherSuite.getImplemented().get(0)); context.setTalkingConnectionEndType(ConnectionEndType.CLIENT); handler.adjustTLSContext(message); }