Skip to content

Fix HTTPTransport's ssl configuration #1626

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

Merged
merged 3 commits into from
Nov 22, 2021
Merged

Conversation

st0012
Copy link
Collaborator

@st0012 st0012 commented Nov 21, 2021

Transport's configuration allows users to configure ssl options with a Ruby hash:

configuration.transport.ssl = { key: value }

or with specific options:

configuration.transport.ssl_verification = false
configuration.transport.ssl_ca_file = file

But there's a bug that will always override the ssl (Hash) option's verify and ca_file values with specific options' values (usually nil in this case).

This bug seems to exist for years (from sentry-raven era), which makes me wonder if anyone really uses the ssl option 🤔

The PR fixes the issue and adds tests for all transport configuration options.

@st0012 st0012 added this to the 4.8.1 milestone Nov 21, 2021
@st0012 st0012 self-assigned this Nov 21, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2021

Codecov Report

Merging #1626 (941e514) into master (b61bc0d) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1626      +/-   ##
==========================================
- Coverage   98.50%   98.49%   -0.01%     
==========================================
  Files         133      133              
  Lines        7336     7382      +46     
==========================================
+ Hits         7226     7271      +45     
- Misses        110      111       +1     
Impacted Files Coverage Δ
sentry-ruby/lib/sentry/transport/http_transport.rb 100.00% <100.00%> (ø)
sentry-ruby/spec/contexts/with_request_mock.rb 100.00% <100.00%> (ø)
...-ruby/spec/sentry/transport/http_transport_spec.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/breadcrumb.rb 95.65% <0.00%> (-4.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b61bc0d...941e514. Read the comment docs.

@st0012 st0012 force-pushed the improve-http-transport-tests branch from ed7b3f8 to 941e514 Compare November 21, 2021 12:07
@st0012 st0012 requested a review from sl0thentr0py November 21, 2021 12:10
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

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

which makes me wonder if anyone really uses the ssl option

^^

lgtm!

@st0012 st0012 merged commit 805b692 into master Nov 22, 2021
@st0012 st0012 deleted the improve-http-transport-tests branch November 22, 2021 17:48
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.

3 participants