-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add support for self-signed certificates #127
Comments
Ruby uses the system trust store, so it should accept your self-signed certificate if it's trusted by the system and it's valid (ie: it matches the domain name it's being used for, it's not expired, the chain of trust is correct...). Note that you can set Adding an option to disable SSL verification to |
Hi @albertvaka ... thanks for responding. The system trust store has the valid cert as I can run curl and wget without any issues. We are already setting node['datadog']['url'] to HAProxy address that's why its picking up the HAProxy address and failing because of the self-signed certificate. I can confirm that it is point to the HAProxy address in the agent datadog.yaml file. We are ok with either adding disable SSL verification or explicitly passing the trust store location which would mean that you may need to update the client initialisation with it if set. |
The following code is what
Sorry to insist on this 🙏 but I really want to understand what's going on, even if disabling SSL works for you. The code above should be really similar to doing a Also, is there any reason you are using |
|
@albertvaka - output above. I've also provided wget output that's working. I agree that we could use http given its all suppose to be internal however there's a company-wide mandate to use https everywhere. |
👍 Thanks a lot for your help, it really looks like Ruby and wget don't act the same way... 😕 I don't want to annoy you with more questions, so I will implement the fix now and add to my backlog to investigate this Ruby problem with a custom CA later. Thanks for your patience 🙇 |
Can you try the new version? If you are using chef to deploy the handler you should pass |
We have HAProxy setup between the datadog agents and datadoghq which is using a self-signed certificate.
At the moment there is no provision on this line given below to pass OpenSSL::SSL::VERIFY_NONE or something similar to handle self-signed certificates in case of HAProxy or similar:
https://github.com/DataDog/dogapi-rb/blob/9ccd737200d693a5a817f04b32b3c00aec6c8697/lib/dogapi/common.rb#L99
Please note: The root CA is already installed at the global os level.
Raising this issue so we can add support in this gem once the related issue (to add support) in dogapi is resolved:
DataDog/dogapi-rb#243
We can achieve this by either reading a chef attribute or using the datadog.yaml config (skip_ssl_validation: true) or something similar to make it work.
The text was updated successfully, but these errors were encountered: