-
Notifications
You must be signed in to change notification settings - Fork 6
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 TLS support - amqp.DialTLS #7
Comments
Hi @gbolo. I left that TODO in there as a reminder, but I haven't managed to get back to it yet. Please feel free to submit a PR if you wish. I don't think I'll have time to tackle it this month :( |
Hi @mihaitodor. Any particular strategy/preference I should follow before attempting this PR? |
@gbolo I am caught up in some other project this week, so I'll try to have a look next week in detail, because I'm not at all familiar with setting up TLS for Sensu (we don't use this feature internally). At a high level, the config plumbing is already done here, so I think it might be enough to just call But, maybe the first step would be to get a test setup going similar to that docker-compose environment that you created for this bug. It would be really helpful to be able to have a Ruby client that already works with TLS configured and then just try to swap it with the Go client to test. If you can provide that, I can put in some time to help with the code changes. |
@mihaitodor Thanks for tips! I will get to working on it during free time |
hi @mihaitodor, So I am testing some code modifications to your HA rabbitmq setup to add tls support. However, I can't seem to get the config to load properly. Can you provide some insight? I am building: upfluence/sensu-client-go then loading this config (with no env variables set) with
However, seems like the client just ignores it and uses some defaults:
Am I missing something? |
@gbolo Indeed, improving the documentation is still on my TODO list :( Basically, you need to modify sensu-client.go and use something like this: sensuConfig, err := sensu.NewConfigFromFlagSet(sensu.ExtractFlags())
if err != nil {
log.Fatalf("Error reading Sensu config: %s", err)
}
haConfig, err := sensuConfig.RabbitMQHAConfig()
if err != nil {
log.Fatalf("Error reading RabbitMQ HA config: %s", err)
}
transport := rabbitmq.NewRabbitMQHATransport(haConfig)
sensuClient := sensu.NewClient(transport, sensuConfig)
err = sensuClient.Start()
if err != nil {
log.Fatalf("Failed to start the Sensu client: %s", err)
} |
Hi @mihaitodor, |
Yeah, Dial is the same (a simple wrapper for DialConfig), but I'd rather use the library functions as much as possible, since they might change in the future. Also, |
Hi @mihaitodor, So i finished adding TLS support and tested it with various configs. I changed the default dialer to use Please note that I have removed all GoDeps from the code and am pointing to the current |
Hi @mihaitodor, TLS can be tested as follows:
|
Hi @gbolo, Thanks for sharing your updates! I will try to allocate some time to look at it in detail. Your code looks promising, but it needs some adjustments and testing in order to fit nicely into this library. Having this |
Any plans on adding TLS support via
amqp.DialTLS
? I do see it mentioned, not sure if your still working on it. I'm very new to golang, I could attempt a PR, but I wouldn't bother if your already working on it.The text was updated successfully, but these errors were encountered: