-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Remove deprecated tlsEnabled config from broker and functions worker #12473
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
Remove deprecated tlsEnabled config from broker and functions worker #12473
Conversation
|
@BewareMyPower It would be better to have a discussion in the dev email list. |
|
@codelipenghui Okay, I'll do that. |
133f614 to
9b45d78
Compare
|
It looks like there's something wrong with Pulsar Functions tests. I'll revert the changes for |
|
It looks like there're still some test failures about Pulsar Functions with TLS, I'll investigate soon. |
|
These test failed because after reverting changes for It looks like these tests failed when the |
|
I also found some other error logs. Since it's not an important bug or feature, I won't take much time to find the reason. So close this PR at this moment. |
Motivation
The
tlsEnabledconfig was marked as deprecated a long time ago. See #2831 for broker's config and #2988 for functions worker's config. This config is confused and meaningless. Because even iftlsEnabledis true, the client or admin still cannot connect to the TLS advertised address (likepulsar+ssl://localhost:6651) or TLS web service URL (likehttps://localhost:8081) if the service is not running.Currently there're two cases that check
tlsEnabled.tlsEnabledis false, even ifisRequestHttpsis true, which means the admin sent the original request tohttps://<host>:<port>, the redirect URL will be the plaintext URL (http://<host>:<port>). However, in this case broker might not have a HTTP service on plaintext web service URL, so redirecting tohttp://<host>:<port>is illegal.tlsEnabledis false in functions worker's config,WorkerConfig#getTlsEnabledwill always return false even if theworkerPortis configured whileworkerPortTlsis configured.Modifications
tlsEnabledcheck inWorkerConfig#getTlsEnabled.isWebServiceTlsEnabledmethod inServiceConfiguration, which returns whether there's a TLS web service endpoint. Then replace allisTlsEnabled()calls withisWebServiceTlsEnabled().PulsarService#isBrokerClientTlsEnabledandWebSocketService#createClientInstance, checkisBrokerClientTlsEnabled()for whether to connect a TLS service endpoint.tlsEnabledfromServiceConfigurationandWorkerConfig, as well as the references.This change could break two existing use cases.
tlsEnabledis true while no TLS web service is running. In this case, forcing client or admin to connect a nonexistent service .tlsEnabledis false while both TLS and plaintext web service are running. In this case, running a TLS web service is meaningless. I suspect whether there's someone tried to do this. It's more like a mistake.For built-in admin or client, we have the
brokerClientTlsEnabledconfig to determine whether to connect TLS service for built-inPulsarAdminandPulsarClient.Documentation
Add the
doc-requiredlabel because we need to remove this deprecated config from website page like https://pulsar.apache.org/docs/en/reference-configuration/.