mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #412] Disable SMTP TLS verify #159
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ajgon on GitHub (Jan 7, 2023).
Original GitHub issue: https://github.com/lldap/lldap/issues/412
I'm using custom SMTP relay in my k8s cluster, with self-signed certificates. Unfortunatelly, I can't make LLDAP o speak with it, I'm getting this error:
Is it possible to disable cert verification (or TLS/STARTTLS altogether) ?
@nitnelave commented on GitHub (Jan 7, 2023):
It should be possible to provide the certificate in the config, and configure lettre (the email lib) to accept that as an additional root certificate in the TLS parameters.
It's not trivial, but it's possible.
In the meantime, why not get a properly signed certificate with letsencrypt?
@ajgon commented on GitHub (Jan 8, 2023):
The problem is, I'm using relay inside k8s cluster - which means, I'm using k8s domains like
relay.mail.svc.cluster.localetc. - which can't be (as far as I'm aware of) registered in LE. And fiddling with that system is cumbersome, and does more harm than good in my opinion.Passing custom certs is the "proper" way of doing this, but again it's a PITA in k8s (you need to create certs in one pod, create secrets, migrate them through namespaces etc.), and (again in my opinion) not worth the effort.
The simplest and widely accepted solution in custom networks as this, is just disable SSL verification. You traffic is still encrypted, and you just trade convenience for possibility of MITM attack. Also if somebody can MITM inside your cluster, you have way bigger problem than disabled verification :)
In general certificate management is cumbersome, and I think it's a good idea, to add option to disable verification (which is by default off, meaning verification is enabled), so if user wants to do this, they explicitly have to say so.
@nitnelave commented on GitHub (Jan 8, 2023):
Yeah, I looked at the docs again, and it's possible to disable certificate
checks.
How do you feel about trying to do a PR? It wouldn't require a lot of Rust.
On Sun, 8 Jan 2023, 16:06 Igor Rzegocki, @.***> wrote:
@ajgon commented on GitHub (Jan 8, 2023):
Funny thing is, I've written some code in Rust long time ago... but don't remember a thing :D Maybe it's worth to do a little refresh... I'll try, and see where it gets me :)
@nitnelave commented on GitHub (Jan 8, 2023):
I'm sure you'll do fine, it shouldn't be too complicated. A few tips:
builder you have a
dangerous_method to disable the certificate checks.configuration.rs and cli.rs (for the command line override flag). Also add
it to the docker config example at the top level. It should probably be a
positive flag (enable_certificate_check?) defaulting to true
That should be enough to get you started, don't hesitate to ask here or in
discord if you need help!
On Sun, 8 Jan 2023, 19:29 Igor Rzegocki, @.***> wrote:
@ajgon commented on GitHub (Jan 18, 2023):
Hmmm... I think, more-or-less I have a implementation ready but... does even smtp encryption config option works? I've tested it on current "releases" build, to be sure it wasn't affected by my changes:
As you can see, regardless of option set, it still uses TLS 😱
Edit: draft PR is here: https://github.com/nitnelave/lldap/pull/423

@nitnelave commented on GitHub (Jan 18, 2023):
It seems the command line override is not well configured here:
https://github.com/nitnelave/lldap/blob/main/server/src/infra/configuration.rs#L269
Which means that config or environnement variables work, but not the
command line flag.
On Wed, 18 Jan 2023, 20:55 Igor Rzegocki, @.***> wrote:
@ajgon commented on GitHub (Jan 18, 2023):
Hmm... looks like, envs are also broken:
but config works :)
Edit: Ah, I see your point - let me try to fix that...
@nitnelave commented on GitHub (Jan 24, 2023):
Solved with #423