Skip to content

Conversation

@sarroutbi
Copy link
Contributor

@sarroutbi sarroutbi commented Apr 14, 2025

Refactor the get_https_client function to eliminate code duplication
between the secure and insecure client configuration paths.

This change creates a single reqwest::Client::builder instance and
conditionally applies either danger_accept_invalid_certs(true) for
insecure mode or loads and adds the root certificate specified via
--certificate for secure mode.

This correctly avoids reading and processing the certificate file
unnecessarily when running with --insecure, fixing a logical
inconsistency where the certificate was loaded even if ignored.

@sarroutbi sarroutbi force-pushed the 2025041604-do-not-use-cert-on-insecure-mode branch 3 times, most recently from 135eb24 to ba6f1c4 Compare April 14, 2025 14:20
Refactor the get_https_client function to eliminate code duplication
between the secure and insecure client configuration paths.

This change creates a single reqwest::Client::builder instance and
conditionally applies either danger_accept_invalid_certs(true) for
insecure mode or loads and adds the root certificate specified via
--certificate for secure mode.

This correctly avoids reading and processing the certificate file
unnecessarily when running with --insecure, fixing a logical
inconsistency where the certificate was loaded even if ignored.

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@sarroutbi sarroutbi force-pushed the 2025041604-do-not-use-cert-on-insecure-mode branch from ba6f1c4 to d554cbd Compare April 14, 2025 14:38
@codecov
Copy link

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 63.57%. Comparing base (17a33ae) to head (d554cbd).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
keylime-push-model-agent/src/main.rs 88.88% 1 Missing ⚠️
Additional details and impacted files
Flag Coverage Δ
e2e-testsuite 63.57% <88.88%> (+0.09%) ⬆️
upstream-unit-tests 63.57% <88.88%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
keylime-push-model-agent/src/main.rs 86.84% <88.88%> (+10.59%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ansasaki ansasaki merged commit cb8070e into keylime:master Apr 14, 2025
15 checks passed
@sarroutbi sarroutbi deleted the 2025041604-do-not-use-cert-on-insecure-mode branch May 12, 2025 16:20
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