Skip to content
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

Correctly place the SSL channel handler in front of the PostgresChannelHandler #527

Merged
merged 3 commits into from
Dec 8, 2024

Conversation

tkrajacic
Copy link
Contributor

@tkrajacic tkrajacic commented Dec 8, 2024

Ensure that NIOSSLClientHandler is added immediately before PostgresChannelHandler instead of at the front of the entire pipeline.
This ensures that TLS works correctly when working with preexisting channels, such as tunneling connections with NIOSSH. See also #526 .

Thanks to @Joannis and @gwynne for finding the problem and pointing me to the right place to fix it.

Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

Great patch! See comments. Pretty sure you will need to fix some tests.

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.76%. Comparing base (f2a6394) to head (0e648c1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...es/PostgresNIO/Connection/PostgresConnection.swift 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #527      +/-   ##
==========================================
- Coverage   61.77%   61.76%   -0.01%     
==========================================
  Files         125      125              
  Lines       10072    10072              
==========================================
- Hits         6222     6221       -1     
- Misses       3850     3851       +1     
Files with missing lines Coverage Δ
...urces/PostgresNIO/New/PostgresChannelHandler.swift 84.50% <100.00%> (ø)
...es/PostgresNIO/Connection/PostgresConnection.swift 42.75% <33.33%> (ø)

... and 1 file with indirect coverage changes

Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

Great patch! Thanks!

@fabianfett fabianfett added the semver-patch No public API change. label Dec 8, 2024
@fabianfett fabianfett merged commit 96ed89f into vapor:main Dec 8, 2024
9 checks passed
@tkrajacic tkrajacic deleted the fix-handler-order branch December 9, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants