-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
correctly install default ssl socket factory when no key or trust store #13589
correctly install default ssl socket factory when no key or trust store #13589
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13589 +/- ##
============================================
+ Coverage 61.75% 62.08% +0.32%
+ Complexity 207 198 -9
============================================
Files 2436 2558 +122
Lines 133233 140972 +7739
Branches 20636 21869 +1233
============================================
+ Hits 82274 87516 +5242
- Misses 44911 46830 +1919
- Partials 6048 6626 +578
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -0,0 +1,367 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to reviewers: there is no logic change, just rename the file name
if (keyStorePath == null && trustStorePath == null) { | ||
// When neither keyStorePath nor trustStorePath is provided, a SSLFactory cannot be created. create SSLContext | ||
// directly and use the default key manager and trust manager. | ||
sc = SSLContext.getInstance(SSL_CONTEXT_PROTOCOL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this guaranteed to be not null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the protocol SSL
is valid, so SSLContext.getInstance(SSL_CONTEXT_PROTOCOL)
is guaranteed to be not null
When changing the ssl context to be swappable, the logic of installing default ssl socket factory when no key or trust store was broken. Specifically, we can install default ssl socket factory when no key or trust store before changing the ssl context to be swappable, but cannot do it any more after the change.
This PR fixes the issue.