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

Is it possible to connect to a q process that requires TLS? #64

Closed
travis-leith opened this issue Mar 9, 2022 · 14 comments
Closed

Is it possible to connect to a q process that requires TLS? #64

travis-leith opened this issue Mar 9, 2022 · 14 comments

Comments

@travis-leith
Copy link

worst case I can use stunnel probably (maybe).

@jshinonome
Copy link
Owner

Added TLS option in 2.5.1, not sure if it works. I don't have a process with TLS to test. Give it a try and let me know.

@jshinonome
Copy link
Owner

image

@travis-leith
Copy link
Author

vs code tells me "unable to verify the first certificate". Not sure if this is a server setup problem or something that can be fixed by the extension. I will try to speak to someone who knows more about TLS than I do, and report back.

@travis-leith
Copy link
Author

This StackOverflow question seems to be relevant: https://stackoverflow.com/questions/31673587/error-unable-to-verify-the-first-certificate-in-nodejs

Based on this, the I think the solution is to do one or both of the following

  1. provide a mechanism to specify a path to a root certificate
  2. provide the ability to disable certificate verification

@jshinonome
Copy link
Owner

Still required? I will try to add a path option for certificate.

@travis-leith
Copy link
Author

Yes, that would be awesome!

@jshinonome
Copy link
Owner

jshinonome commented Mar 31, 2022

https://nodejs.org/api/tls.html#tlsconnectoptions-callback
tls.connect(options[, callback])
There is no option for cert path, but servername...
Could you check if any option on the page I can use?

@travis-leith
Copy link
Author

I am not an expert on these matters but I don't think servername is the right option here. Another (potentially less secure) option is to have another checkbox to control the rejectUnauthorized parameter. Would that be something you can consider?

@jshinonome
Copy link
Owner

I will give it a try.

@jshinonome
Copy link
Owner

I added the option rejectUnauthorized, not sure if it works. Please try v2.5.2 and let me know.

	if (params.useTLS) {
		socketArgs.push({ rejectUnauthorized: false })
	}

@travis-leith
Copy link
Author

Thanks, I am away from the office until 11th. Will report back by then.

@travis-leith
Copy link
Author

I have managed to test this, I am getting this now

image

Is this error coming from vscode-q, nodeq, or somewhere else?

@jshinonome
Copy link
Owner

from node-q...I guess unless you can write some code that connects from node to a q TLS process. I cannot really do anything else.

@travis-leith
Copy link
Author

My mistake, this is working, I was not using it properly. Thanks for this!

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

2 participants