Skip to content

Fix OpenSslClientSessionCache remove#14366

Merged
chrisvest merged 1 commit intonetty:4.1from
chrisvest:4.1-ssl-session-remove
Sep 24, 2024
Merged

Fix OpenSslClientSessionCache remove#14366
chrisvest merged 1 commit intonetty:4.1from
chrisvest:4.1-ssl-session-remove

Conversation

@chrisvest
Copy link
Copy Markdown
Member

Motivation:
Loop was adding nativeSslSession to the toBeRemoved list, instead of the loop variable sslSession.

Modification:
Add the loop variable instead, because the nativeSslSession can very likely be null at that point, and is specifically also not the session we want to remove.

Result:
Fewer bugs in SSL session caching

Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very likely be null at that point, and is specifically also not the session we want to remove.

Result:
Fewer bugs in SSL session caching
@chrisvest chrisvest added this to the 4.1.114.Final milestone Sep 23, 2024
toBeRemoved = new ArrayList<NativeSslSession>(2);
}
toBeRemoved.add(nativeSslSession);
toBeRemoved.add(sslSession);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is there a good way to test for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests in #14358 catch it. I'll add a more focused test there.

@chrisvest chrisvest merged commit bbd3a4a into netty:4.1 Sep 24, 2024
@chrisvest chrisvest deleted the 4.1-ssl-session-remove branch September 24, 2024 04:00
@normanmaurer
Copy link
Copy Markdown
Member

🤦 Thanks for fixing

normanmaurer pushed a commit that referenced this pull request Sep 24, 2024
Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of
the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very
likely be null at that point, and is specifically also not the session
we want to remove.

Result:
Fewer bugs in SSL session caching
normanmaurer added a commit that referenced this pull request Sep 24, 2024
Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of
the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very
likely be null at that point, and is specifically also not the session
we want to remove.

Result:
Fewer bugs in SSL session caching

Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
normanmaurer pushed a commit that referenced this pull request Sep 24, 2024
Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of
the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very
likely be null at that point, and is specifically also not the session
we want to remove.

Result:
Fewer bugs in SSL session caching
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.

3 participants