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

MqttClient asks for private key #377

Closed
georgemakrakis opened this issue Jul 24, 2018 · 10 comments
Closed

MqttClient asks for private key #377

georgemakrakis opened this issue Jul 24, 2018 · 10 comments

Comments

@georgemakrakis
Copy link

georgemakrakis commented Jul 24, 2018

Hello,

I have the following bug, when trying to connect to a mosquitto broker on a server using the following options, i get the following error about the Private Key, but i am using the server,crt to authenticate which has no private key assigned.

Code:

image

Error

image

Any help will be appreciated, thanks!

@ralsu091
Copy link

The error is not related to this library, you will probably need to have the private key of the certificate.

@georgemakrakis
Copy link
Author

Well i think is not possible to have the server's certificate private key, due to security reasons.

@ralsu091
Copy link

ralsu091 commented Jul 24, 2018 via email

@ralsu091
Copy link

Are you trying to verify the server certificate? or use this certificate to connect with the broker?

@georgemakrakis
Copy link
Author

Yes i am trying to connect with the broker, the certificate is self-signed by the ca.crt which actually is the server.

@ralsu091
Copy link

You need a different certificate for the client connection. I suggest posting a question on StackOverflow to get better answers.

Good luck!

@georgemakrakis
Copy link
Author

georgemakrakis commented Jul 26, 2018

I also tried to use client certificates made with OpenSSL including their private key too but the error keeps up.

@lore4
Copy link

lore4 commented Sep 6, 2018

Hey @georgemakrakis , it seems that you should create a pkcs12 file (as stated in #202). This pkcs12 has to include: server certificate, CA certificate, and client/private key. However, I am experiencing still some issue to complete the connection with TLS.

Did you solve your issue?

@georgemakrakis
Copy link
Author

georgemakrakis commented Sep 7, 2018

Hello @lore4, no i have changed the entire architecture and design of the solution i wanted to implement. I have wrote some custom connection using web-socket for this. I have also tried to create the pkcs12 file with all the files included but then the program told be that i couldn't verify the server certificate even if i have added the property to do it (.WithTls(true,....), so i abandoned the use of this package for my project.

@lore4
Copy link

lore4 commented Sep 7, 2018

Hi @georgemakrakis ,
ouch... it seems that it won't be cool for me :-(
Thank you for your answer! ;-)

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

4 participants