pulsar-manager
pulsar-manager copied to clipboard
Adding https support for backend service
Motivation:
With tls enabled, admin instance was getting created with the wrong URL, leading to a 401 error for all the requests from the manager backend service
Manager log
Create Pulsar Admin instance. url=http://localhost:8080/, authPlugin=org.apache.pulsar.client.impl.auth.AuthenticationTls, authParams=tlsCertFile:client-cert.pem,tlsKeyFile:client-key.pem, tlsAllowInsecureConnection=false, tlsTrustCertsFilePath=cacert.pem, tlsEnableHostnameVerification=false
Broker log
2022-08-26T00:29:55,864-0700 [pulsar-web-42-22] INFO org.apache.pulsar.broker.PulsarService - created admin with url http://localhost:8080/
Modifications
- When tls enabled, getting the tls service URL.
- Modifying the HTTP broker URL to use the protocol and port from the original service URL.
We can check the schema of the serviceUrl
to use the HTTP/HTTPS.