You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "nodece (via GitHub)" <gi...@apache.org> on 2023/02/10 14:27:09 UTC
[GitHub] [pulsar] nodece opened a new pull request, #19485: [fix][proxy] Fix JKS TLS transport
nodece opened a new pull request, #19485:
URL: https://github.com/apache/pulsar/pull/19485
Fixes #19480
### Motivation
In the old version, if the user wants to use the TLS transport, the user must use the `AuthenticationTls`. In Pulsar 2.11, I submitted #15634, and #16833 to split the TLS transport from the `Authentication`, the user can set the TLS transport with any `Authentication`.
During the improvement, I did not pass the KeyStore config to `NettySSLContextAutoRefreshBuilder` in the `DirectProxyHandler`, and did not improve the order in which the KeyStore is loaded, so the proxy cannot work fine.
### Modifications
- Improve the load of the KeyStore, `authData.getTlsKeyStoreParams()` take precedence over the config file
- Pass the KeyStore config to `NettySSLContextAutoRefreshBuilder`
### Verifying this change
- [x] Make sure that the change passes the CI checks.
Added the `ProxyKeyStoreTlsTransportTest` to cover this change.
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] nodece commented on a diff in pull request #19485: [fix][proxy] Fix JKS TLS transport
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on code in PR #19485:
URL: https://github.com/apache/pulsar/pull/19485#discussion_r1110709487
##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/keystoretls/NettySSLContextAutoRefreshBuilder.java:
##########
@@ -101,8 +100,14 @@ public NettySSLContextAutoRefreshBuilder(String sslProviderString,
this.tlsAllowInsecureConnection = allowInsecureConnection;
this.tlsProvider = sslProviderString;
- this.authData = authData;
-
+ if (authData != null) {
+ KeyStoreParams authParams = authData.getTlsKeyStoreParams();
+ if (authParams != null) {
+ keyStoreTypeString = authParams.getKeyStoreType();
+ keyStore = authParams.getKeyStorePath();
+ keyStorePassword = authParams.getKeyStorePassword();
+ }
+ }
this.tlsKeyStoreType = keyStoreTypeString;
this.tlsKeyStore = new FileModifiedTimeUpdater(keyStore);
this.tlsKeyStorePassword = keyStorePassword;
Review Comment:
When the `authData` is available, I override the `keyStoreTypeString`, `keyStore`, and `keyStorePassword` by the `authData.getTlsKeyStoreParams()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] nodece merged pull request #19485: [fix][proxy] Fix JKS TLS transport
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece merged PR #19485:
URL: https://github.com/apache/pulsar/pull/19485
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codecov-commenter commented on pull request #19485: [fix][proxy] Fix JKS TLS transport
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #19485:
URL: https://github.com/apache/pulsar/pull/19485#issuecomment-1442884573
# [Codecov](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#19485](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4a98e50) into [master](https://codecov.io/gh/apache/pulsar/commit/e2863391e7f6f9b6c5060f0f78378493f8df37f3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e286339) will **increase** coverage by `1.85%`.
> The diff coverage is `14.06%`.
[](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #19485 +/- ##
============================================
+ Coverage 60.44% 62.29% +1.85%
- Complexity 3494 25917 +22423
============================================
Files 1832 1844 +12
Lines 135153 135518 +365
Branches 14871 14914 +43
============================================
+ Hits 81693 84425 +2732
+ Misses 45869 43346 -2523
- Partials 7591 7747 +156
```
| Flag | Coverage Δ | |
|---|---|---|
| inttests | `24.59% <5.81%> (-0.09%)` | :arrow_down: |
| systests | `25.26% <6.72%> (?)` | |
| unittests | `59.58% <13.45%> (+0.52%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...lance/extensions/ExtensibleLoadManagerWrapper.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL0V4dGVuc2libGVMb2FkTWFuYWdlcldyYXBwZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...xtensions/channel/ServiceUnitStateChannelImpl.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL2NoYW5uZWwvU2VydmljZVVuaXRTdGF0ZUNoYW5uZWxJbXBsLmphdmE=) | `0.55% <0.00%> (-0.11%)` | :arrow_down: |
| [...ns/channel/ServiceUnitStateCompactionStrategy.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL2NoYW5uZWwvU2VydmljZVVuaXRTdGF0ZUNvbXBhY3Rpb25TdHJhdGVneS5qYXZh) | `11.42% <0.00%> (-1.91%)` | :arrow_down: |
| [...lance/extensions/channel/ServiceUnitStateData.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL2NoYW5uZWwvU2VydmljZVVuaXRTdGF0ZURhdGEuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...java/org/apache/pulsar/admin/cli/CmdFunctions.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC10b29scy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2FkbWluL2NsaS9DbWRGdW5jdGlvbnMuamF2YQ==) | `46.95% <0.00%> (-0.25%)` | :arrow_down: |
| [...ar/functions/source/MultiConsumerPulsarSource.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWZ1bmN0aW9ucy9pbnN0YW5jZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Z1bmN0aW9ucy9zb3VyY2UvTXVsdGlDb25zdW1lclB1bHNhclNvdXJjZS5qYXZh) | `89.47% <0.00%> (-4.98%)` | :arrow_down: |
| [...r/functions/source/SingleConsumerPulsarSource.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWZ1bmN0aW9ucy9pbnN0YW5jZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Z1bmN0aW9ucy9zb3VyY2UvU2luZ2xlQ29uc3VtZXJQdWxzYXJTb3VyY2UuamF2YQ==) | `93.33% <0.00%> (-6.67%)` | :arrow_down: |
| [...he/pulsar/functions/utils/FunctionConfigUtils.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWZ1bmN0aW9ucy91dGlscy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Z1bmN0aW9ucy91dGlscy9GdW5jdGlvbkNvbmZpZ1V0aWxzLmphdmE=) | `63.10% <33.33%> (+10.14%)` | :arrow_up: |
| [...va/org/apache/pulsar/broker/service/ServerCnx.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1NlcnZlckNueC5qYXZh) | `55.61% <50.00%> (+1.36%)` | :arrow_up: |
| [.../pulsar/compaction/StrategicTwoPhaseCompactor.java](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NvbXBhY3Rpb24vU3RyYXRlZ2ljVHdvUGhhc2VDb21wYWN0b3IuamF2YQ==) | `74.56% <52.17%> (-1.74%)` | :arrow_down: |
| ... and [281 more](https://codecov.io/gh/apache/pulsar/pull/19485?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] nodece commented on pull request #19485: [fix][proxy] Fix JKS TLS transport
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on PR #19485:
URL: https://github.com/apache/pulsar/pull/19485#issuecomment-1432748494
/pulsarbot rerun-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] Technoboy- closed pull request #19485: [fix][proxy] Fix JKS TLS transport
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed pull request #19485: [fix][proxy] Fix JKS TLS transport
URL: https://github.com/apache/pulsar/pull/19485
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] michaeljmarshall commented on a diff in pull request #19485: [fix][proxy] Fix JKS TLS transport
Posted by "michaeljmarshall (via GitHub)" <gi...@apache.org>.
michaeljmarshall commented on code in PR #19485:
URL: https://github.com/apache/pulsar/pull/19485#discussion_r1110693867
##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/keystoretls/NettySSLContextAutoRefreshBuilder.java:
##########
@@ -101,8 +100,14 @@ public NettySSLContextAutoRefreshBuilder(String sslProviderString,
this.tlsAllowInsecureConnection = allowInsecureConnection;
this.tlsProvider = sslProviderString;
- this.authData = authData;
-
+ if (authData != null) {
+ KeyStoreParams authParams = authData.getTlsKeyStoreParams();
+ if (authParams != null) {
+ keyStoreTypeString = authParams.getKeyStoreType();
+ keyStore = authParams.getKeyStorePath();
+ keyStorePassword = authParams.getKeyStorePassword();
+ }
+ }
this.tlsKeyStoreType = keyStoreTypeString;
this.tlsKeyStore = new FileModifiedTimeUpdater(keyStore);
this.tlsKeyStorePassword = keyStorePassword;
Review Comment:
Nit: is there a reason we're not updating these in the above if block?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org