@Override protected CertificateMessage createHandshakeMessage() { return new CertificateMessage(); }
if (config.getHighestProtocolVersion().isTLS13()) { if (config.isClientAuthentication()) { messages.add(new CertificateMessage(config)); messages.add(new CertificateVerifyMessage(config)); messages.add(new CertificateMessage(config)); addClientKeyExchangeMessage(messages); messages.add(new CertificateVerifyMessage(config));
public static Certificate fetchServerCertificate(Config config) { WorkflowTrace trace = new WorkflowTrace(); trace.addTlsAction(new SendAction(new ClientHelloMessage(config))); trace.addTlsAction(new ReceiveTillAction(new CertificateMessage(config))); State state = new State(config, trace); WorkflowExecutor workflowExecutor = WorkflowExecutorFactory.createWorkflowExecutor( WorkflowExecutorType.DEFAULT, state); try { workflowExecutor.executeWorkflow(); if (!state.getTlsContext().getTransportHandler().isClosed()) { state.getTlsContext().getTransportHandler().closeConnection(); } } catch (IOException | WorkflowExecutionException E) { LOGGER.warn("Could not fetch ServerCertificate"); LOGGER.debug(E); } return state.getTlsContext().getServerCertificate(); }
messages.add(new CertificateMessage()); } else { messages.add(new CertificateMessage(config)); if (!selectedCipherSuite.isSrpSha() && !selectedCipherSuite.isPskOrDhPsk() && !selectedCipherSuite.isAnon()) { if (connection.getLocalConnectionEndType() == ConnectionEndType.CLIENT) { messages.add(new CertificateMessage()); } else { messages.add(new CertificateMessage(config));
messageList.add(new CertificateMessage(tlsConfig)); messageList.add(new ServerHelloDoneMessage(tlsConfig)); workflowTrace.addTlsAction(new ReceiveAction(messageList));