-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Connect over TLS using a client certificate #945
Comments
Does the solution from #115 (comment) work for you? |
Hi @SeppPenner, the code in the comment uses the following method to provide the TLS options:
The two last arguments are byte arrays in that code (and I am guessing that the first three bools are flags for untrusted certs etc. In v3.0.11, the |
Ok, sorry. I missed this change somehow. |
Here's the code that works:
CA Cert is in .crt format, and the client cert should be in PFX, and should have the password that was used to export the file from private key and cert originally. The PFX was created using openssl as below:
|
This should be documented, I guess. |
So, I finally found the time and added this to the wiki as well: https://github.com/chkr1011/MQTTnet/wiki/Client#tls-using-a-client-certificate. |
Describe your question
How do I connect to a broker over TLS, using a client certificate?
Which project is your question related to?
As in issue #115, I am looking to configure the client to do the MQTT Fx equivalent of the below:

Please advise on how I could specify the CA Cert, the Client Cert and the key file. I looked at the code that is mentioned in that issue, but the .WithTLS() signature in that code doesn't seem to be present in 3.0.11. I tried:
In the Certificates collection, what is the order in which the certs are specified? Or should I specify these in some other way?
Thanks in advance.
The text was updated successfully, but these errors were encountered: