Skip to content

fix(g3-types): replace unsafe unwrap() with proper error handling in openssl cert pair - #1103

Merged
zh-jq merged 1 commit into
bytedance:masterfrom
lxcxjxhx:fix/unsafe-unwrap-in-openssl-cert-pair
Jul 31, 2026
Merged

zh-jq merged 1 commit into
bytedance:masterfrom
lxcxjxhx:fix/unsafe-unwrap-in-openssl-cert-pair

Conversation

@lxcxjxhx

Copy link
Copy Markdown
Contributor

Fixes #1102

Replace panic-prone .unwrap() calls with proper error handling in OpenSSL certificate pair initialization.

Changes:

  • cert_pair.rs: 4 unwrap() calls replaced
  • tlcp_cert_pair.rs: 7 unwrap() calls replaced
  • Fixed copy-paste error in error messages

cc @Danielhaiman @zh-jq

@zh-jq

zh-jq commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Thank you for this PR. You can also submit it here https://github.com/VEY-OSS/vey.

@zh-jq
zh-jq merged commit ac4f482 into bytedance:master Jul 31, 2026
23 of 118 checks passed
@codecov

codecov Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.64%. Comparing base (6b21580) to head (35a1831).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
lib/g3-types/src/net/openssl/cert_pair.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1103      +/-   ##
==========================================
- Coverage   67.69%   67.64%   -0.06%     
==========================================
  Files        1432     1432              
  Lines      136755   136759       +4     
==========================================
- Hits        92573    92507      -66     
- Misses      44182    44252      +70     
Flag Coverage Δ
g3bench 19.76% <0.00%> (-0.01%) ⬇️
g3keymess 20.76% <0.00%> (+<0.01%) ⬆️
g3mkcert 26.73% <ø> (ø)
g3proxy 49.84% <50.00%> (-0.07%) ⬇️
g3statsd 5.58% <ø> (ø)
lib 57.86% <0.00%> (-0.01%) ⬇️

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

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

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

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.

Code Quality: Unsafe unwrap() calls in crypto initialization and connection pool access

2 participants