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

Support self signed certificates #185

Closed
hguerrero opened this issue May 6, 2021 · 25 comments
Closed

Support self signed certificates #185

hguerrero opened this issue May 6, 2021 · 25 comments
Labels
authentication enhancement New feature or request
Milestone

Comments

@hguerrero
Copy link

When connecting to cluster using TLS, the certificate might be a self-signed cert.

Today we receive an error, but there is no documentation on how to configure the cert to validate it.

@angelozerr
Copy link
Collaborator

I think it's the same issue than #86

@chonbash
Copy link

I have same problem. At #86 I didn't find solution.

@hguerrero
Copy link
Author

#86 still open and tries to address SASL_SSL, so I guess it should fix the usage of any TLS endpoint. However, I suggest using this issue to track the specifics of using self-signed certs within any TLS type of config.

@angelozerr
Copy link
Collaborator

angelozerr commented May 14, 2021

I have same problem. At #86 I didn't find solution.

Yes sure, it's just some discussion. The issue which implements the idea with certificate (and another configuration) is #88

But please note if you have the capability to write a vscode extension, you can contribute to vscode-kafka with your cluster configuration. You extension could create the proper kafka config with the proper certificate https://kafka.js.org/docs/configuration#ssl

If you are interested to write your own vscode extension, please see the sample at https://github.com/angelozerr/vscode-kafka-extension-sample/blob/f3470cb0ab8777085e256571eeecc20fd77a7a83/src/extension.ts#L106

For the moment, there is no a robust documentation,please add comment in #129 if you need a documentation.

However, I suggest using this issue to track the specifics of using self-signed certs within any TLS type of config.

Ok thanks for your suggestion.

@fbricon
Copy link
Collaborator

fbricon commented Jul 1, 2021

@hguerrero can you try the CI build from https://github.com/jlandersen/vscode-kafka/actions/runs/987534310 and give some feedback?

@angelozerr
Copy link
Collaborator

@hguerrero please note that there is a bug with ca, cert, key file save settings. Once you have selected the file, please add a space and remove a space on each file fields before saving. I'm fixing that.

@hguerrero
Copy link
Author

Sure, I'll give it a try

@hguerrero
Copy link
Author

Hey, @angelozerr what type of file do I need to get for the certificate authority? right now I tried, crt, pem, and keystore but I'm not able to select any using the browse button.

@angelozerr
Copy link
Collaborator

Its a mistake that i did. I need to add another file extensions. Please use the expected file extension for the moment by renaming your file extension. I will fix that soon

@hguerrero
Copy link
Author

Ok, adding the full path in the textbox worked.

Awesome work folks!

I was able to connect with no trouble

image

@fbricon
Copy link
Collaborator

fbricon commented Jul 2, 2021

@hguerrero was your certificate self-signed?

@hguerrero
Copy link
Author

Yes, it was @fbricon

@fbricon
Copy link
Collaborator

fbricon commented Jul 2, 2021

Cool, thanks. FYI, @angelozerr has made some more improvements to the proposed changes, including fixing the file browsing. You can try a newer build from https://github.com/jlandersen/vscode-kafka/actions/runs/994037689

@hguerrero
Copy link
Author

@fbricon I tested the new version, but unfortunately is not working.

Looks like when using the browse button:

  • I can now select my file
  • The file does not show in the textbox
  • When I click on Finish the server is created but the cert is not linked

So, when trying to connect to my cluster I still get the self-signed cert error.

If I add manually the path in the textbox, as I did with the previous version it works.

@fbricon
Copy link
Collaborator

fbricon commented Jul 6, 2021

@hguerrero what OS are you on?

@fbricon
Copy link
Collaborator

fbricon commented Jul 6, 2021

@hguerrero
Copy link
Author

@hguerrero what OS are you on?

MacOS Big Sur v11.4

@hguerrero
Copy link
Author

@hguerrero have you tried the latest build from https://github.com/jlandersen/vscode-kafka/actions/workflows/ci.yml?query=is%3Asuccess ?

No, used the 6days old, let me try with the one from 1hr ago.

@hguerrero
Copy link
Author

Ok, I can confirm that the latest build (700) worked correctly.

@fbricon
Copy link
Collaborator

fbricon commented Jul 6, 2021

Fixed with #193

@fbricon fbricon closed this as completed Jul 6, 2021
@fbricon fbricon added authentication enhancement New feature or request labels Jul 6, 2021
@fbricon fbricon added this to the 0.13.0 milestone Jul 6, 2021
@kasperschnack
Copy link

kasperschnack commented Jan 17, 2022

Hi guys! First of all, thank you for making kafka available in vs code. I'm really looking forward to ditching the expensive conduktor I have to use through VNC. However I'm getting this error as well. I might have more than just this issue though - not sure:

  1. I have this issue and I don't understand how I'm supposed to fix it
  2. In conduktor I simply have to point to my truststore.jks file. I converted it using this method. However this only creates a single PEM file. And I'm prompted for three different files in your setup:
    image

not really sure which one to pick or if I'm missing files? Any help would be greatly appreciated! <3

I'm on Windows 10 Enterprise with a remote to a VM running Ubuntu 18.04.4 LTS btw :)

@angelozerr
Copy link
Collaborator

@kasperschnack to be honnest with you, I have none knowledge about JKS, etc. I have just consumed the kafkajs API and the expected tls ConnectionOptions :

If it requires some changes, any feedback are welcome, thanks!

@IvanKostyuk
Copy link

Cannot connect using v0.15.0
Cannot find old build for v0.13.0

@IvanKostyuk
Copy link

The certificate I issued does not have correct hostnames, more than that, I'm playing with cluster of 3 brokers.
Need to have ability to bypass host validation.

Failed operation - Connection error: Hostname/IP does not match certificate's altnames: IP: is not in the cert's list

@fbricon
Copy link
Collaborator

fbricon commented Jul 29, 2022

To install a prior version:
Screenshot 2022-07-29 at 09 14 28
Screenshot 2022-07-29 at 09 14 45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authentication enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants