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

Server#closed_socket? - parameter may be a MiniSSL::Socket #2596

Merged
merged 1 commit into from Apr 18, 2021

Conversation

MSP-Greg
Copy link
Member

@MSP-Greg MSP-Greg commented Apr 10, 2021

Description

Similar code and naming is used Server#cork_socket & Server#uncork_socket...

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

@MSP-Greg MSP-Greg requested a review from dentarg April 10, 2021 19:43
@dentarg
Copy link
Member

dentarg commented Apr 11, 2021

Is it correct that without this change, if you use Puma to terminate SSL/TLS, you aren't getting the benefit of #1227?

If that's the case, would be good to change the PR title so that info is reflected in the changelog/history – I didn't understand what this was about until I read the chat where #1227 was linked :)

@dentarg
Copy link
Member

dentarg commented Apr 11, 2021

Similar code and naming is used Server#cork_socket & Server#uncork_socket

Yeah I'm not a big fan of "skt" 😆 but I will 🙈

Copy link
Member

@dentarg dentarg left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@dentarg dentarg left a comment

Choose a reason for hiding this comment

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

Can we test this?

@dentarg
Copy link
Member

dentarg commented Apr 11, 2021

Can we test this?

I see that #1227 didn't add a test, I wonder if tests have been added later on or if this is untested? 🤔

@MSP-Greg
Copy link
Member Author

Sorry. I wasn't clear. I should have seen it before.

The MiniSSL::Socket isn't related to IO or any Socket, it just has a few methods that make it appear IO like. But, it has a TCPSocket that it 'connects' with. So, testing whether Client#io.is_a? TCPSocket will never pass, but testing Client#io.to_io.is_a? TCPSocket will. Same thing is done at the start of cork_socket and uncork_socket.

Or, when passing in a MiniSSL::Socket or OpenSSL::Socket to methods that also handle TCPSocket or UNIXSocket , one needs to be careful for what tests/methods are with them...

@nateberkopec nateberkopec merged commit 28a4cb2 into puma:master Apr 18, 2021
@MSP-Greg MSP-Greg deleted the 00-to-io branch November 2, 2021 22:54
JuanitoFatas pushed a commit to JuanitoFatas/puma that referenced this pull request Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants