Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Option to ignore tls certs (self signed) #12

Closed
vijaybandari opened this issue Nov 11, 2016 · 12 comments
Closed

Option to ignore tls certs (self signed) #12

vijaybandari opened this issue Nov 11, 2016 · 12 comments

Comments

@vijaybandari
Copy link

No description provided.

@djenriquez
Copy link
Owner

Thanks for the request @vijaybandari. I'm currently looking into how to do this via the HTTP API and will get it out soon.

@vijaybandari
Copy link
Author

Looked at the npm module (axios) you are using and here is the flag to skip tls verification.

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

axios/axios#12 (comment)

Locally tested it by adding the above line to login.js and it worked fine. Will try to implementing it properly (node is not my cup of tea, but will give a try) :)

@djenriquez
Copy link
Owner

djenriquez commented Nov 11, 2016

Gotcha, it actually rejects on Axios (node), makes sense! Definitely feel free to submit a PR, otherwise we can implement it soon.

@djenriquez
Copy link
Owner

@vijaybandari I was thinking about this and I don't think this is something that should be done through the UI. This is because the UI that you are loading to can serve multiple clients. If you were to change the node environment with NODE_TLS_REJECT_UNAUTHORIZED through the UI, say with a check box or something, you would actually be changing it for everyone who also is processing from that same backend.

I believe the best way to enable this is through the docker run by specifying -e NODE_TLS_REJECT_UNAUTHORIZED=0. By doing this, you are explicit that all requests being served by this UI are allowed unauthorized tls requests, which will provide the same experience for all requests.

Can you try running vault-ui with

docker run -d \
-p 8000:8000 \
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
--name vault-ui \
djenriquez/vault-ui

and tell me if that works?

@vijaybandari
Copy link
Author

It didn't work. I think this sets environment variable at system level (docker) & not accessible by node.

@djenriquez
Copy link
Owner

Ok, I'll look into a commander argument for running vault-ui with the necessary flag. Just to clarify, you said adding process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; did what you needed it to correct?

@vijaybandari
Copy link
Author

yes DJ

@djenriquez
Copy link
Owner

You added this to login.js?

@vijaybandari
Copy link
Author

Yes.

@vijaybandari
Copy link
Author

@djenriquez Wait, I think it's working. Not sure why it didn't work earlier. I will test it completly, give me sometime.

@vijaybandari
Copy link
Author

vijaybandari commented Nov 15, 2016

It's weird, it didn't work earlier (was using 4 days old docker image). Could be my docker setup issue, today docker itself stopped working and have to reset and pull latest image and works perfectly fine. Thank you very much for your help.
You can close this issue by adding that command to Readme :)

@djenriquez
Copy link
Owner

Reference commit 5c215f4e. Closing, thanks for helping get this set up @vijaybandari!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants