Skip to content

SSLFilter socket linger#1178

Merged
chrjohn merged 5 commits intoquickfix-j:masterfrom
the-thing:ssl-filter-lingering
Apr 1, 2026
Merged

SSLFilter socket linger#1178
chrjohn merged 5 commits intoquickfix-j:masterfrom
the-thing:ssl-filter-lingering

Conversation

@the-thing
Copy link
Copy Markdown
Contributor

Fix lingering message in SSL filter.

Changes

  • linger flag set to true for initiator and acceptor

org.apache.mina.filter.ssl.SslFilter#onClose supports linger parameter that writes any queued messages before closing.

https://github.com/apache/mina/blob/9e45469b747d9d77de754ba1bc7c9bf0d4d67b89/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java#L337

This fixes last handshake message described in #1166 but it will also flush any other messages that are queued which is probably desired. With this change - quickfix.mina.HttpProxyTest#shouldLoginBasicAuthWithSsl doesn't throw the exception (make sure that debug logging works to see before and after change).

@the-thing the-thing marked this pull request as draft March 30, 2026 07:46
@the-thing
Copy link
Copy Markdown
Contributor Author

@chrjohn

Should we

  1. leave the PR as is
  2. make it configurable
    2a) with default value linger = Y
    2b) with default value linger = N

@chrjohn chrjohn changed the title SSL filter socket linger SSLFilter socket linger Mar 30, 2026
@chrjohn chrjohn added this to the QFJ 3.0.1 milestone Mar 30, 2026
@chrjohn
Copy link
Copy Markdown
Member

chrjohn commented Mar 30, 2026

@the-thing thank you.
I'd opt for 1 since (as you said) we probably want to flush the messages.

@the-thing the-thing marked this pull request as ready for review March 30, 2026 15:49
@the-thing
Copy link
Copy Markdown
Contributor Author

These messages are not FIX messages - different queue. The messages affected are related to SSL handshake etc.

@chrjohn
Copy link
Copy Markdown
Member

chrjohn commented Mar 31, 2026

Yes, I understood that. :) thanks

@chrjohn chrjohn merged commit 23610bb into quickfix-j:master Apr 1, 2026
12 checks passed
@the-thing the-thing deleted the ssl-filter-lingering branch April 1, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants