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

Fix location of verify_peer check #5

Merged
merged 3 commits into from
May 14, 2024

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented May 14, 2024

Fixes a couple of issues I introduced in #2. I didn’t notice these issues because the tests that they broke weren’t being run in CI, so I’ve sorted that out too. See commit messages for more details.

I put this in the wrong place in 9996b7b. In the pre-9996b7b version of
the code, when verify_peer was false, no server certificate verification
was performed.

I had misread the previous code and thought that verify_peer being false
just meant that it would not check that the server certificate matched
the hostname, which is what the warning message suggested; I’ve fixed
the warning message here too.

Also, my mistake in 9996b7b did introduce a bunch of test failures, but
I didn’t notice them because on GitHub Actions these tests weren’t being
run due to some misbehaviour of the requires_connection test helper;
I’ll remove that helper in an upcoming commit.
Mistake in 9996b7b, which I missed since CI wasn’t running the relevant
tests (as described in 139a59b).

(Older versions of the OpenSSL gem hadn’t implemented certificate #==
method; see ruby/openssl#158.)
@lawrence-forooghian lawrence-forooghian force-pushed the fix-location-of-verify-peer-check branch from 809ff8c to 4a44908 Compare May 14, 2024 14:46
The aim of this helper is to cause some tests to be skipped if there is
no Internet connection. For some reason (which I haven’t investigated)
when run on GitHub Actions these tests are always being skipped, causing
me to not notice the test failures fixed in 139a59b.

I am happy to remove this check; presumably if there’s no Internet
connection then the affected tests will just fail, and that’s fine by
me. I understand the intent of the author in adding this helper, and
understand that being able to run some of the test suite offline may be
a desirable thing, but I think not at the cost of it hiding failing
tests by default.

(There’s also a requires_port helper which is only used in the
proxy-related tests; in order to remove that one we’d need to start
running proxies locally and in CI, and I don’t want to spend time on
that now. We don’t make use of this library’s proxy functionality in
ably-ruby.)

Enabling these tests on CI caused Ruby 2.2 to segfault; I have no idea
of the cause (it exists on the pre-fork version of this library too) and
I don’t want to look into it given that we only support Ruby 2.7+ for
ably-ruby, so I’ve just removed Ruby 2.2 from CI.
@lawrence-forooghian lawrence-forooghian force-pushed the fix-location-of-verify-peer-check branch from 4a44908 to b2f3b4b Compare May 14, 2024 18:39
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review May 14, 2024 18:46
Copy link
Collaborator

@sacOO7 sacOO7 left a comment

Choose a reason for hiding this comment

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

Lgtm

@lawrence-forooghian lawrence-forooghian merged commit 9c08d0d into master May 14, 2024
9 checks passed
@lawrence-forooghian lawrence-forooghian deleted the fix-location-of-verify-peer-check branch May 14, 2024 19:51
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