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

Allow TLS verification to be skipped #181

Open
Xiol opened this issue Jun 21, 2021 · 6 comments
Open

Allow TLS verification to be skipped #181

Xiol opened this issue Jun 21, 2021 · 6 comments

Comments

@Xiol
Copy link

Xiol commented Jun 21, 2021

Hello,

In production we're using valid TLS certificates only for securing the connection, not validating the client. However in test I'm using self-signed certificates for this. There doesn't appear to be a way to disable the NATS client from attempting to verify the TLS certificate of the server. It would be nice to have this option.

Thanks

@ripienaar
Copy link
Collaborator

Are you signing the certs using a internal CA for test purpose? This is quite easy and then you just tell it the path to the CA?

@Xiol
Copy link
Author

Xiol commented Jun 21, 2021

No, I didn't want to go through the hassle of setting up a CA.

@ripienaar
Copy link
Collaborator

It's the right thing to do though and its really easy.

That said, server does support disabling verify so seems reasonable CLI should too, its a easy PR if you want to else it might take some time.

@thorntonmc
Copy link

Bumping on a slightly different request - would it be possible to report that the server's certificate is not trusted? Currently the NATS CLI just fails with an "i/o timeout" -- but it would be great to report that the x509 certificate was signed by an unknown authority - or whatever the trust issue is.

@ripienaar
Copy link
Collaborator

$ nats --tlsca wrong.pem rtt
nats: error: tls: failed to verify certificate: x509: certificate signed by unknown authority

This is already happening

@thorntonmc
Copy link

If I don't supply a --tlsca, then the operation times out. This happens if you're connecting to a context prefixed with tls://, not supplying a CA, and the certificate returned is not trusted.

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

Successfully merging a pull request may close this issue.

3 participants