Skip to content
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

How to use SSL connection #70

Open
jkga007 opened this issue Oct 26, 2018 · 3 comments
Open

How to use SSL connection #70

jkga007 opened this issue Oct 26, 2018 · 3 comments

Comments

@jkga007
Copy link

jkga007 commented Oct 26, 2018

in my site,i use ssl to connect kafka cluster
eg:
security.protocol=SSL
ssl.truststore.location=/kafka-ssl-client/client_java_client.truststore.jks
ssl.keystore.location=/client_java_client.keystore.jks
ssl.truststore.password=test
ssl.keystore.password=test
ssl.key.password=test
how can i use kafka_exporter to connect success?

@shankarsg
Copy link

have you resolved this issue?

@Gangareddy
Copy link

Gangareddy commented May 21, 2020

The args required to enable tls/ssl could be

- --tls.insecure-skip-tls-verify --log.enable-sarama --sasl.enabled --sasl.handshake --sasl.username=kafkabroker --sasl.password=brokerpassword --tls.enabled --web.listen-address=:9308 --tls.ca-file=ca.pem --tls.cert-file=cert.pem --tls.key-file=key.pem

The app uses the caRoot, cert and key file. One needs to create these files from Keystore file instead of using Keystore file directly. The below commands helps you to crreate the file.

pkcs 12

keytool -importkeystore -srckeystore $KEYSTORE_FILE -destkeystore keystore.p12 -deststoretype PKCS12 -srcstorepass $PASSWORD -deststorepass $PASSWORD -noprompt

Private Key

openssl pkcs12 -in keystore.p12 -nocerts -out key.pem -passin pass:$PASSWORD -passout pass:$PASSWORD -nodes

Ca

openssl pkcs12 -cacerts -nokeys -in keystore.p12 -out ca.pem -passin pass:$PASSWORD

Cert

openssl pkcs12 -clcerts -nokeys -in keystore.p12 -out cert.pem -passin pass:$PASSWORD

@zym-cicv
Copy link

@Gangareddy, Hi ,Following your methood, I met a problem as below.
F0515 13:38:55.995480 22998 kafka_exporter.go:893] tls: failed to parse private key

I used openssl command to check the key.pem as below.

openssl rsa -check -in /usr/local/kafka/cert/key.pem
140067303110544:error:0607907F:digital envelope routines:EVP_PKEY_get1_RSA:expecting an rsa key:p_lib.c:287:

what did I miss? thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants