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: respect common env variables #347

Merged
merged 9 commits into from
Dec 19, 2024
Merged

fix: respect common env variables #347

merged 9 commits into from
Dec 19, 2024

Conversation

zFernand0
Copy link
Member

@zFernand0 zFernand0 commented Nov 18, 2024

What It Does

Fixes #346.
Added support for commonly used environmental variables, like REQUESTS_CA_BUNDLE and CURL_CA_BUNDLE

How to Test

  1. Make sure you can run a sample command against an LPAR with valid certificates
    • print((console.issue_command("D T"))['cmd-response'])
  2. Setup a proxy that will function as your custom Certificate Authority.
  3. Specify the proxy as an environmental variable (either in your python script or in the command line)
    • HTTPS_PROXY=https://myproxy.company.net:3129 python test.py
    • Notice the [SSL: CERTIFICATE_VERIFY_FAILED] error
  4. Specify either of the commonly used CA bundle variables with the proper certificate chain combination
    • REQUESTS_CA_BUNDLE=/path/to/combo.crt
    • CURL_CA_BUNDLE=/path/to/combo.crt
    • Note: The combo.crt refers to the complete certificate chain (proxyCA, intermediate/LPAR, global/root)
    • The command should work as expected

Review Checklist
I certify that I have:

Additional Comments

The same can be achieved today using the SSL_CERT_FILE environmental variable

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.09%. Comparing base (4661f83) to head (c3fa843).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #347      +/-   ##
==========================================
- Coverage   89.10%   89.09%   -0.02%     
==========================================
  Files          65       65              
  Lines        3258     3255       -3     
==========================================
- Hits         2903     2900       -3     
  Misses        355      355              
Flag Coverage Δ
unittests 89.09% <100.00%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zFernand0 zFernand0 requested review from traeok, t1m0thyj, gejohnston, awharn, ATorrise and adam-wolfe and removed request for traeok November 18, 2024 17:58
@zFernand0 zFernand0 marked this pull request as ready for review November 18, 2024 17:59
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

Changes look good to me, thanks for the fix Fernando!

Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @zFernand0!

Signed-off-by: Fernando Rijo Cedeno <[email protected]>
@zFernand0
Copy link
Member Author

image

zFernand0 and others added 5 commits December 11, 2024 11:21
@zFernand0 zFernand0 merged commit 0f5afa3 into main Dec 19, 2024
22 checks passed
@zFernand0 zFernand0 deleted the fix-346 branch December 19, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

Core SDK doesn't handle certificates specified via standard ENV vars
5 participants