I’m trying to configure a webhook to ship logs to Logstash but I’m getting this error:
“KumoMTA internal: failed to connect to any candidate hosts: only one connection attempt per session”
The Logstash instance uses self-signed certificates and my best guess is that’s what’s causing the failure. Is there a way to trust the self-signed certs so I can verify that"
KumoMTA typically does not have any issues with self-signed certs. To eliminate that concern, you could set enable_tls to “OpportunisticInsecure” or even “Disabled”
I think it is more likely something else in your configuration or even in Logstash, but it is hard to tell without seeing your full configs.
log_hooks:new_json {
name = 'webhook',
url = 'https://logstash:5044',
log_parameters = {
meta = {'x-master-id', 'x-sender-id'},
},
}
I’ve spun up a simple set up locally with Kumomta, Logstash and Elasticsearch running in docker. I confirmed that i f I disable tls in Logstash and configure use http in the hook url then the webhook works just fine. When I reenable TLS in logstash and update the url to use https, nothing comes through. I’m not getting any errors when running locally either, just no data in logstash.
I’m not seeing the enable_tls option in kumo.http.build_client documentation or code.
When I try an older Kumo image (e.g. kumomta:2024.06.10-84e84b89) the error is different:
make.webhook.log_hook", addr: 0.0.0.0 } }}: kumod::ready_queue: failed to send message id SpoolId
...
kumomta | caused by: error sending request for url (https://testserver:5044/): error trying to connect: invalid peer certificate: Other(CaUsedAsEndEntity)
kumomta | 2025-03-03T20:50:33.346255Z DEBUG readyq-2 kumod::ready_queue: Error in Dispatcher::run for unspecified->webhook.log_hook@lua:make.webhook.log_hook: deliver_message: callback error
kumomta | stack traceback:
kumomta | [C]: in local 'poll'
kumomta | [string "?"]:5: in method 'send'
kumomta | [string "/opt/kumomta/etc/policy/init.lua"]:38: in function <[string "/opt/kumomta/etc/policy/init.lua"]:31>
kumomta | caused by: error sending request for url (https://testserver:5044/): error tryi
```
It works ok with a trusted CA or http.
you need to set SSL_CERT_FILE and/or SSL_CERT_DIR in the environment of the spawned kumod process in order for it to find your adjusted set of trusted certificates if you want its clients to trust your certificates