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

Unable to auth via SASL over SSL #25

Closed
csghuser opened this issue Jul 3, 2018 · 2 comments
Closed

Unable to auth via SASL over SSL #25

csghuser opened this issue Jul 3, 2018 · 2 comments

Comments

@csghuser
Copy link

csghuser commented Jul 3, 2018

I can't seem to get this to work when a listener is configured to use SASL_SSL.
For example, let's say your broker has the following config:

listeners=SASL_SSL://somehost:9092

With the TF config as follows:

provider "kafka" {
  bootstrap_servers = ["somehost:9092"]
  tls_enabled = true
  sasl_username = "username"
  sasl_password = "password"
  skip_tls_verify   = true
}

I just get the following error

Error running plan: 1 error(s) occurred:

* provider.kafka: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

I can connect via a java client, using the following jaas config:

KafkaClient {
        org.apache.kafka.common.security.plain.PlainLoginModule required
        username="username"
        password="password";
    };

(I tested changing the password to something incorrect, and then I can't connect so it does seem to be working).

I'm using the following opts in the working java code:

        PROPS.put("security.protocol","SASL_SSL");
        PROPS.put("sasl.mechanism", "PLAIN");

Any idea what I might be doing wrong?

@csghuser
Copy link
Author

csghuser commented Jul 3, 2018

I think perhaps it is related to IBM/sarama#643

When you create the keystore use -keyalg RSA, then you will get the right ciphers.

Not sure I would have passed that when creating the key, which could be the problem. Not had chance to test it though.

@csghuser
Copy link
Author

csghuser commented Jul 4, 2018

That fixed it for me, recreating the key with -keyalg RSA did the trick.

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

No branches or pull requests

1 participant