-
Notifications
You must be signed in to change notification settings - Fork 8
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
Connecting to a secure zeebe cluster #70
Comments
Hi @mihneastaub , by default the client connects to localhost:26500 using plain text. If Camunda Cloud Credentials are provided it will use SSL/TLS. In your case localhost:26500 seems to be correct but it is falsely connecting with plain text. Unfortunately, we don't have a configuration option yet to configure "usePlainText". We'll add that now because it definitely makes sense. There is a quick solution because you can replace the factory bean. We'll take your issue as a trigger to refactor it to make it easier in future (for similar cases). For now the following class in your project should solve the problem (note: usePlaintext is commented out) import info.novatec.micronaut.zeebe.client.feature.Configuration;
import info.novatec.micronaut.zeebe.client.feature.ZeebeClientFactory;
import io.camunda.zeebe.client.ZeebeClient;
import io.camunda.zeebe.client.ZeebeClientBuilder;
import io.micronaut.context.annotation.Factory;
import io.micronaut.context.annotation.Replaces;
import jakarta.inject.Singleton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Duration;
@Factory
@Replaces(factory = ZeebeClientFactory.class)
public class MyZeebeClientFactory extends ZeebeClientFactory {
private static final Logger log = LoggerFactory.getLogger(MyZeebeClientFactory.class);
@Singleton
public ZeebeClient buildClient(Configuration configuration) {
ZeebeClientBuilder zeebeClientBuilder = isCloudConfigurationPresent(configuration)
? createCloudClient(configuration)
: ZeebeClient.newClientBuilder(); //.usePlaintext();
configuration.getDefaultRequestTimeout().ifPresent(timeout -> zeebeClientBuilder.defaultRequestTimeout(Duration.parse(timeout)));
configuration.getDefaultJobPollInterval().ifPresent(duration -> zeebeClientBuilder.defaultJobPollInterval(Duration.ofMillis(duration)));
configuration.getDefaultJobTimeout().ifPresent(timeout -> zeebeClientBuilder.defaultJobTimeout(Duration.parse(timeout)));
configuration.getDefaultMessageTimeToLive().ifPresent( ttl -> zeebeClientBuilder.defaultMessageTimeToLive(Duration.parse(ttl)));
configuration.getDefaultJobWorkerName().ifPresent(zeebeClientBuilder::defaultJobWorkerName);
configuration.getGatewayAddress().ifPresent(zeebeClientBuilder::gatewayAddress);
configuration.getNumJobWorkerExecutionThreads().ifPresent(zeebeClientBuilder::numJobWorkerExecutionThreads);
configuration.getKeepAlive().ifPresent(keepAlive -> zeebeClientBuilder.keepAlive(Duration.parse(keepAlive)));
configuration.getCaCertificatePath().ifPresent(zeebeClientBuilder::caCertificatePath);
ZeebeClient zeebeClient = zeebeClientBuilder.build();
log.info("ZeebeClient is configured to connect to gateway: {}", zeebeClient.getConfiguration().getGatewayAddress());
return zeebeClient;
}
} Does that solve your issue? |
Hi @tobiasschaefer, Thank you for the quick answer. I will check this and I will comeback to you. |
…rwrite the ZeebeClientBuilder.
…xt/secure connection.
Hi @mihneastaub , I just released v1.4.0 of the micronaut-zeebe-integration. Setting Note: our release v1.4.0 is built with the latest Micronaut 3.3.0 version. The update from your 3.2.7 version should be trivial, i.e. you only need to switch to the new Micronaut version. Please confirm that is working for you. |
Hi @mihneastaub , I provided you with a workaround and also a release which should fix your issue. Please confirm that it works for you. Thanks |
Hi @tobiasschaefer, Sorry for the late response. For now I did not have time to test this... Thank you very much for the workaround and for the fix, much appreciated. I will close this and if something is not working I will open again a new issue. Thanks! |
Hello Guys,
I have a secure zeebe cluster deployed in kubernetes using the helm chart, when I want to connect to the cluster using this client, I have received this error:
The important error is this one:
Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 00001204000000000000037fffffff000400100000000600002000000004080000000000000f0001
Do you know why the client cannot connect to the secure cluster?
Thank you!
The text was updated successfully, but these errors were encountered: