Repository navigation
Closed
Labels
type/bugThe PR fixed a bug or issue reported a bug
Description
To Reproduce
From @evfurman:
I got authentication configured on the brokers.
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 401 Authentication required</title> </head> <body><h2>HTTP ERROR 401 Authentication required</h2> <table> <tr><th>URI:</th><td>/admin/v2/brokers/health</td></tr> <tr><th>STATUS:</th><td>401</td></tr> <tr><th>MESSAGE:</th><td>Authentication required</td></tr> <tr><th>SERVLET:</th><td>org.glassfish.jersey.servlet.ServletContainer-3051e0b2</td></tr> </table> <hr><a href="https://eclipse.org/jetty">Powered by Jetty:// 9.4.33.v20201020</a><hr/> </body> </html>
However, when I try to produce with the pulsar-perf client, I get the following error:
22:30:33.866 [pulsar-client-io-2-1] INFO org.apache.pulsar.client.impl.ConnectionPool - [[id: 0x1327459b, L:/10.3.22.138:59344 - R:pulsar-pluster-01.qa.corp.mparticle.com/10.3.22.230:6651]] Connected to server
22:30:33.883 [pulsar-client-io-2-1] WARN org.apache.pulsar.client.impl.ClientCnx - [id: 0x1327459b, L:/10.3.22.138:59344 - R:pulsar-pluster-01.qa.corp.mparticle.com/10.3.22.230:6651] Received error from server: Unable to authenticate
22:30:33.883 [pulsar-client-io-2-1] WARN org.apache.pulsar.client.impl.ClientCnx - [id: 0x1327459b, L:/10.3.22.138:59344 - R:pulsar-pluster-01.qa.corp.mparticle.com/10.3.22.230:6651] Received unknown request id from server: -1
22:30:33.884 [pulsar-client-io-2-1] INFO org.apache.pulsar.client.impl.ClientCnx - [id: 0x1327459b, L:/10.3.22.138:59344 ! R:pulsar-pluster-01.qa.corp.mparticle.com/10.3.22.230:6651] Disconnected
The client.conf is:
webServiceUrl=https://pulsar-pluster-01.qa.corp.mparticle.com:8443/
brokerServiceUrl=pulsar+ssl://pulsar-pluster-01.qa.corp.mparticle.com:6651/
authPlugin=org.apache.pulsar.client.impl.auth.AuthenticationKeyStoreTls
authParams=keyStoreType:JKS,keyStorePath:/opt/pulsar/tls/keystore.jks,keyStorePassword:XXXXXXXXXXXX
tlsAllowInsecureConnection=false
tlsEnableHostnameVerification=false
useKeyStoreTls=true
tlsTrustStoreType=PEM
tlsTrustStorePath=/opt/pulsar/tls/truststore.jks
tlsTrustStorePassword=XXXXXXXXXXXXX
useTls=true
Metadata
Metadata
Assignees
Labels
type/bugThe PR fixed a bug or issue reported a bug
Activity
Jennifer88huang-zz commentedon Dec 9, 2020
Workaround from @sijie : try to configure
authParamas JSON string.[-]Error occurs when configure auth[/-][+]Error occurs when configure client auth[/+]evfurman commentedon Dec 9, 2020
When converting the authParams to JSON, the error disappears.
authParams={"keyStoreType":"JKS","keyStorePath":"/opt/pulsar/tls/keystore.jks","keyStorePassword":"XXXXXXXXXXX"}However, it seems we are still unable to authenticate.
Jennifer88huang-zz commentedon Dec 10, 2020
@evfurman Thanks for your feedback. I've refined the "brokerClientAuthenticationParameters" as json type as well to configure the client auth.
Have you met issues in configuring other auth, for example, token auth?
Jennifer88huang-zz commentedon Dec 10, 2020
@sijie Except in TLS keystore, in Token auth, JWT, Athenz, Keberos,
brokerClientAuthenticationParametersis used. Shall we change all of them as JSON string?[docs] Configure authParams as JSON (#8870)
[ISSUE 8872][docs] fix the json format of BrokerClientAuthParam (#8920)
Jennifer88huang-zz commentedon Feb 5, 2021
@RobertIndie In #9313, do you mean that since 2.8.0,
brokerClientAuthenticationParameterssupports JSON format for TLS keystore, JWT, Athenz, Keberos?