Skip to content

[AI] Fix: DTLS finishWithCloseNotify override issue (#182) #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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());
}
}