Open dennisokko opened 2 years ago
Config config = Config.createConfig();
config.setDefaultRunningMode(RunningModeType.CLIENT);
OutboundConnection outboundConnection = config.getDefaultClientConnection();
outboundConnection.setPort(Integer.parseInt(args[0]));
config.setDefaultClientConnection(outboundConnection);
config.setDefaultSelectedCipherSuite(CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256);
config.setAddSessionTicketTLSExtension(true);
WorkflowTrace trace = new WorkflowTrace();
trace.addTlsAction(MessageActionFactory.createAction(
config, outboundConnection, ConnectionEndType.CLIENT, new ClientHelloMessage(config)));
trace.addTlsAction(
MessageActionFactory.createAction(
config,
outboundConnection,
ConnectionEndType.SERVER,
new ServerHelloMessage(config),
new CertificateMessage(config),
new ECDHEServerKeyExchangeMessage(config),
new ServerHelloDoneMessage(config)));
trace.addTlsAction(
MessageActionFactory.createAction(
config,
outboundConnection,
ConnectionEndType.CLIENT,
new ECDHClientKeyExchangeMessage(config),
new ChangeCipherSpecMessage(config),
new FinishedMessage(config)));
trace.addTlsAction(
MessageActionFactory.createAction(
config,
outboundConnection,
ConnectionEndType.SERVER,
new ChangeCipherSpecMessage(config),
new FinishedMessage(config)));
config.setUseFreshRandom(false);
config.setUseAllProvidedRecords(true);
ApplicationMessage app1 = new ApplicationMessage(config);
MessageAction messageAction = MessageActionFactory.createAction(
config,
outboundConnection,
ConnectionEndType.CLIENT,
app1);
trace.addTlsAction(messageAction);
MessageAction messageAction2 = MessageActionFactory.createAction(
config,
outboundConnection,
ConnectionEndType.CLIENT,
app1);
messageAction2.setMessages(messageAction.getMessages());
messageAction2.setRecords(messageAction.getRecords());
System.out.println(messageAction.getReadableString());
trace.addTlsAction(messageAction2);
State state = new State(config, trace);
WorkflowExecutor workflowExecutor =
WorkflowExecutorFactory.createWorkflowExecutor(config.getWorkflowExecutorType(), state);
workflowExecutor.executeWorkflow();
this is my code, i try to use the firse message's message and records to replay the second one, but before execution, it is null.