nodece opened a new pull request, #23905:
URL: https://github.com/apache/pulsar/pull/23905
### Motivation
I encountered an issue when using Kerberos and TLS transport to connect to
the broker. The `pulsar-admin` and `pulsar-client` (for HTTP lookup) failed to
work as expected.
In the
`org.apache.pulsar.client.impl.auth.AuthenticationSasl#authenticationStage`
method, the broker requests should use the `WebTarget` provided by the
`pulsar-admin` or `pulsar-client` HTTP clients. However, the current
implementation creates a new HTTP client to construct the `WebTarget`, causing
the TLS context to be lost.
Currently, the `pulsar-admin` HTTP client is built on `javax.ws.rs` and AHC
(Async Http Client), while the `pulsar-client` HTTP client relies only on AHC.
To resolve this inconsistency and maintain the TLS context, we need to refactor
the `pulsar-client` to provide the required `WebTarget`.
### Modifications
1. **Package Changes:**
- Renamed `org.apache.pulsar.client.admin.internal.http` to
`org.apache.pulsar.client.internal.http`.
- Moved the renamed package from `pulsar-client-admin` to
`pulsar-client`.
2. **Refactored HTTP Client:**
- Refactored `HttpClient.java` to use `AsyncHttpConnectorProvider` and
`AsyncHttpConnector` for a unified and consistent implementation.
3. **Fixed Client Calls:**
- Updated `pulsar-client` calls to utilize the refactored HTTP client and
maintain the TLS context seamlessly.
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]