Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public void applyDelegate(Config config) {
th = TransportHandlerType.UDP;
config.setDefaultLayerConfiguration(StackConfiguration.DTLS);
config.setWorkflowExecutorType(WorkflowExecutorType.DTLS);
config.setFinishWithCloseNotify(true);
config.setIgnoreRetransmittedCssInDtls(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,47 @@ public void testNothingSetNothingChanges() {
delegate.applyDelegate(config);
assertTrue(EqualsBuilder.reflectionEquals(config, config2, "certificateChainConfig"));
}

@Test
public void testDTLSDoesNotOverrideFinishWithCloseNotify() {
Config config = new Config();
// Set finishWithCloseNotify to false explicitly
config.setFinishWithCloseNotify(false);

String[] args = new String[2];
args[0] = "-version";
args[1] = "DTLS12";

jcommander.parse(args);
delegate.applyDelegate(config);

// Verify that finishWithCloseNotify remains false and is not overridden
assertFalse(config.isFinishWithCloseNotify());

// Verify other DTLS settings are still applied correctly
assertSame(ProtocolVersion.DTLS12, config.getHighestProtocolVersion());
assertSame(
TransportHandlerType.UDP,
config.getDefaultClientConnection().getTransportHandlerType());
assertSame(
TransportHandlerType.UDP,
config.getDefaultServerConnection().getTransportHandlerType());
}

@Test
public void testDTLSRespectsTrueFinishWithCloseNotify() {
Config config = new Config();
// Set finishWithCloseNotify to true explicitly
config.setFinishWithCloseNotify(true);

String[] args = new String[2];
args[0] = "-version";
args[1] = "DTLS12";

jcommander.parse(args);
delegate.applyDelegate(config);

// Verify that finishWithCloseNotify remains true
assertTrue(config.isFinishWithCloseNotify());
}
}