Closed dompie closed 6 months ago
Is it possible to put our self-signed cert somwhere, so that elixir/keila recognizes it as trusted certificate?
Erlang/OTP should be using the operating system CA store these days. You could try adding it like this:
COPY my-cert.pem /usr/local/share/ca-certificates/my-cert.crt
RUN cat /usr/local/share/ca-certificates/my-cert.crt >> /etc/ssl/certs/ca-certificates.crt
via https://stackoverflow.com/a/67232164 (I haven’t personally tried it)
We have added our certificate to the OS certs location. Openssl now verifies without an error, but unfortunately keila logs keep telling me
08:25:45.034 [notice] TLS :client: In state :certify at ssl_handshake.erl:2123 generated CLIENT ALERT: Fatal - Bad Certificate
08:25:45.035 [warning] Failed sending email to test7@example.com for campaign nmc_neLWkLwd: {:retries_exceeded, {:temporary_failure, ~c"172.16.252.31", :tls_failed}}
Any other ideas how to skip verification or teach keila about our certificates?
Since you’re using an internal IP address, you might also get around the issue by disabling SSL altogether for now.
Debugging this would be kinda hard for me since I can't test it directly. If you have a similar SMTP server with a public IP available with a self-signed certificate, I could take a closer look.
We ended up with an additional Docker container working as SMTP relay and configuring Keila to use "no connection security". So we now have the following authentication/communication order:
Keila -> SMTP relay -> Self-Signed Certificate SMTP Server
It would have been easier if Keila allowed the use of SMTP without username and password.
An option to skip certificate verification in Keila would definitely have saved several hours of work.
I use Keila 0.14.4 and want to send newsletters via our SMTP-Server.
The error message for SSL/TLS with port 587 looks like:
With STARTTLS and port 587 I get the following error:
So I think I need to use STARTTLS. I can connect to our mail server on port 587 from the machine where the docker container is running.
When I double check with openssl, I see the following output
Is there a way to skip certificate check before sending - or to have it use my sender anyway? Or any other options?