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 connect to consul agent with tls enabled #35

Open
xelite opened this issue Apr 7, 2020 · 0 comments
Open

Unable connect to consul agent with tls enabled #35

xelite opened this issue Apr 7, 2020 · 0 comments

Comments

@xelite
Copy link

xelite commented Apr 7, 2020

I have consul cluster with tls enabled. I've also some agents with disabled incoming verify and i am trying to setup cluster with consul discovery. I've added this jars to my hazelcast CLASSPATH:

consul-client-1.4.2.jar
converter-jackson-2.8.1.jar
guava-28.2-jre.jar
hazelcast-consul-discovery-spi-1.0-RC9.jar
jackson-annotations-2.9.10.jar
jackson-core-2.9.10.jar
jackson-databind-2.9.10.jar
jackson-datatype-guava-2.10.3.jar
jackson-datatype-jdk8-2.10.3.jar
kotlin-stdlib-1.3.71.jar
okhttp-4.4.0.jar
okio-2.5.0.jar
retrofit-2.8.1.jar
slf4j-api-1.7.30.jar

Next I've adjust hazelcast-consul-discovery-spi-example.xml and run hazelcast, but got some TLS errors:

Apr 07, 2020 6:35:08 AM com.hazelcast.spi.discovery.integration.DiscoveryService
SEVERE: [10.222.0.2]:5701 [hazelcast-consul-discovery-spi] [3.9.1] Unexpected error in configuring discovery: Error connecting to Consul
com.orbitz.consul.ConsulException: Error connecting to Consul
	at com.orbitz.consul.AgentClient.ping(AgentClient.java:69)
	at com.orbitz.consul.Consul$Builder.build(Consul.java:731)
	at org.bitsofinfo.hazelcast.discovery.consul.ConsulClientBuilder.buildConsul(ConsulClientBuilder.java:76)
	at org.bitsofinfo.hazelcast.discovery.consul.ConsulDiscoveryStrategy.<init>(ConsulDiscoveryStrategy.java:146)
	at org.bitsofinfo.hazelcast.discovery.consul.ConsulDiscoveryStrategyFactory.newDiscoveryStrategy(ConsulDiscoveryStrategyFactory.java:46)
	at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.buildDiscoveryStrategy(DefaultDiscoveryService.java:185)
	at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.loadDiscoveryStrategies(DefaultDiscoveryService.java:145)
	at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.<init>(DefaultDiscoveryService.java:60)
	at com.hazelcast.spi.discovery.impl.DefaultDiscoveryServiceProvider.newDiscoveryService(DefaultDiscoveryServiceProvider.java:29)
	at com.hazelcast.instance.Node.createDiscoveryService(Node.java:265)
	at com.hazelcast.instance.Node.<init>(Node.java:216)
	at com.hazelcast.instance.HazelcastInstanceImpl.createNode(HazelcastInstanceImpl.java:160)
	at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:128)
	at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:195)
	at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:174)
	at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:124)
	at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:58)
	at com.hazelcast.core.server.StartServer.main(StartServer.java:46)
Caused by: java.net.UnknownServiceException: Unable to find acceptable protocols. isFallback=false, modes=[ConnectionSpec(cipherSuites=[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA], tlsVersions=[TLS_1_3, TLS_1_2], supportsTlsExtensions=true), ConnectionSpec()], supported protocols=[TLSv1]
	at okhttp3.internal.connection.ConnectionSpecSelector.configureSecureSocket(ConnectionSpecSelector.kt:63)
	at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.kt:361)
	at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.kt:325)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:197)
	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:233)
	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:107)
	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:75)
	at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:245)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:74)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
	at com.orbitz.consul.cache.TimeoutInterceptor.intercept(TimeoutInterceptor.java:53)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
	at com.orbitz.consul.Consul$Builder.lambda$withAclToken$2(Consul.java:419)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:148)
	at retrofit2.OkHttpCall.execute(OkHttpCall.java:190)
	at com.orbitz.consul.AgentClient.ping(AgentClient.java:62)
	... 17 more

Apr 07, 2020 6:35:08 AM com.hazelcast.spi.discovery.integration.DiscoveryService
INFO: [10.222.0.2]:5701 [hazelcast-consul-discovery-spi] [3.9.1] Registered our service instance w/ Consul OK.. delaying Hazelcast discovery, sleeping: 10000ms
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