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

Error: consumer can't find certificate #2

Open
johnMinelli opened this issue Jan 12, 2020 · 4 comments
Open

Error: consumer can't find certificate #2

johnMinelli opened this issue Jan 12, 2020 · 4 comments
Labels
question Further information is requested

Comments

@johnMinelli
Copy link

Hi i've an error in the log of the consumer since it can't find the certificate, i guess the problem is in the simulator config: what do i need to put in the field caCertificate?

@ctron
Copy link
Owner

ctron commented Jan 13, 2020

you need to put in the base64 encoded CA bundle of your AMQP endpoint

@ctron ctron added the question Further information is requested label Jan 13, 2020
@johnMinelli
Copy link
Author

I'm getting this but i don't know if i'm making a mistake with the certificate or i miss something else...
(I'm working in Minikube and as a messaging network i'm using the one in the deploy of Hono)

hono-artemis ClusterIP 10.96.82.250 "none" 5671/TCP 5d14h
hono-dispatch-router ClusterIP 10.96.28.132 "none" 5673/TCP 5d14h
hono-dispatch-router-ext LoadBalancer 10.96.223.211 10.96.223.211 15671:30671/TCP,15672:30672/TCP 5d14h

Producer log:

#devices: 10, #threads: 10
Auto Register: true
TLS insecure: false
Vertx Native: true
OpenSSL - available: true -> OpenSSL 1.0.2k-fips  26 Jan 2017
Key Manager: true
Host name validation: true
Device Registry - Version: V1, URL: http://10.96.94.138:28080

Consumer log:

Key Manager: true
Host name validation: true
TLS enabled
Using OpenSSL for proton
16:55:24.953 [vert.x-eventloop-thread-1] INFO  o.e.hono.client.impl.HonoClientImpl - stopping connection attempt to server [host: 10.96.223.211, port: 15671] due to terminal error
javax.security.sasl.AuthenticationException: Failed to authenticate
	at io.vertx.proton.impl.ProtonSaslClientAuthenticatorImpl.handleSaslFail(ProtonSaslClientAuthenticatorImpl.java:159)
	at io.vertx.proton.impl.ProtonSaslClientAuthenticatorImpl.process(ProtonSaslClientAuthenticatorImpl.java:98)
	at io.vertx.proton.impl.ProtonTransport.processSaslAuthentication(ProtonTransport.java:211)
	at io.vertx.proton.impl.ProtonTransport.handleSocketBuffer(ProtonTransport.java:194)
	at io.vertx.core.net.impl.NetSocketImpl$DataMessageHandler.handle(NetSocketImpl.java:392)
	at io.vertx.core.streams.impl.InboundBuffer.handleEvent(InboundBuffer.java:225)
	at io.vertx.core.streams.impl.InboundBuffer.write(InboundBuffer.java:123)

ecc.

I watched here the conf example: https://github.com/ctron/iot-simulator-operator/blob/develop/examples/config/simulator.yaml

For the caCertificate i went to kubernetes dashboard > Secrets > hono-dispatch-router-conf
and there i found the token: qdrouter-cert.pem, qdrouter-key.pem, trusted-certs.pem.
I thoght it was the first one...
I've also watched here https://www.eclipse.org/hono/docs/dev-guide/java_client_consumer/#encryption-of-communication about the trusted-certs.pem and comparing the ApplicationBaseExample with you consumer code, but probably i'm only messing up the things... do I maybe need to generate my certs?
Anyway do I need to register the tenant, device and credentials? (I've done it) Or there are maybe other steps to connect, that i'm missing?

On kube dashboard everything seems fine except for the consumer.
Thanks for the help

@ctron
Copy link
Owner

ctron commented Jan 14, 2020

The javax.security.sasl.AuthenticationException looks more like an issue with the credentials. The "ca cert" is for accepting the TLS connection, from a client side perspective. The fact that you already get the authentication error would indicate to me that the TLS handshake is already working.

I am not so familiar with the raw Hono deployment, as I mostly work with Hono deployed via https://enmasse.io

@websterbye
Copy link

Hi, I encounter the same problem, everything seems fine except consumer, deploy on kubenernetes on the server, but It keeping complaing authentication exeception, read https://github.com/ctron/iot-simulator-operator/blob/develop/examples/config/simulator.yaml and https://www.eclipse.org/hono/docs/dev-guide/java_client_consumer/#encryption-of-communication, but still don't know how to get the credentials. If you have found the cause of the problem or know how to configure the credentials, possible to share with us? Thank you in advance.

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

No branches or pull requests

3 participants