From edba5d84780a91c258b04004ce404ac0b366480e Mon Sep 17 00:00:00 2001 From: Rhywden Date: Mon, 24 Aug 2026 09:19:10 +0200 Subject: [PATCH] Debugging connection issues to ldap/redis/postgres --- Wollmilchsau/Dockerfile | 3 ++- Wollmilchsau/Services/Ldap/LdapService.cs | 7 ++++++- Wollmilchsau/appsettings.Development.json | 4 ++-- Wollmilchsau/appsettings.json | 6 +++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Wollmilchsau/Dockerfile b/Wollmilchsau/Dockerfile index 3d34eed..871e49c 100644 --- a/Wollmilchsau/Dockerfile +++ b/Wollmilchsau/Dockerfile @@ -4,10 +4,11 @@ FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base USER root RUN apt-get update \ - && apt-get install --yes --no-install-recommends libldap2 \ + && apt-get install --yes --no-install-recommends ca-certificates libldap2 \ && rm -rf /var/lib/apt/lists/* USER $APP_UID WORKDIR /app +ENV LDAPTLS_CACERT=/etc/ssl/certs/ca-certificates.crt EXPOSE 8080 EXPOSE 8081 diff --git a/Wollmilchsau/Services/Ldap/LdapService.cs b/Wollmilchsau/Services/Ldap/LdapService.cs index bd55214..1a2c042 100644 --- a/Wollmilchsau/Services/Ldap/LdapService.cs +++ b/Wollmilchsau/Services/Ldap/LdapService.cs @@ -90,9 +90,14 @@ public sealed class LdapService(IOptions options) : ILdapService var connection = new LdapConnection(new LdapDirectoryIdentifier(ldapUri.Host, ldapUri.Port)) { AuthType = AuthType.Basic, - Timeout = TimeSpan.FromSeconds(30) + Timeout = TimeSpan.FromSeconds(30), + SessionOptions = + { + SecureSocketLayer = true + } }; + connection.SessionOptions.ProtocolVersion = 3; connection.SessionOptions.SecureSocketLayer = string.Equals(ldapUri.Scheme, "ldaps", StringComparison.OrdinalIgnoreCase); connection.Bind(new NetworkCredential(_options.BindDN, _options.BindPassword)); diff --git a/Wollmilchsau/appsettings.Development.json b/Wollmilchsau/appsettings.Development.json index 2c611b8..09f7bf7 100644 --- a/Wollmilchsau/appsettings.Development.json +++ b/Wollmilchsau/appsettings.Development.json @@ -26,8 +26,8 @@ }, "ConnectionStrings": { - "Marten": "Host=lxc-db3;Port=5432;Database=wollmilchsau_dev;Username=wollmilchsau;Password=rVx0EoLDOnld", - "RedisCache": "lxc-matrix:6379" + "Marten": "Host=lxc-db3.tail859cae.ts.net;Port=5432;Database=wollmilchsau_dev;Username=wollmilchsau;Password=rVx0EoLDOnld", + "RedisCache": "lxc-matrix.tail859cae.ts.net:6379" }, "OIDC": { "Authority": "https://id.bs18.de/realms/master", diff --git a/Wollmilchsau/appsettings.json b/Wollmilchsau/appsettings.json index 24be98b..ad759ba 100644 --- a/Wollmilchsau/appsettings.json +++ b/Wollmilchsau/appsettings.json @@ -27,8 +27,8 @@ }, "ConnectionStrings": { - "Marten": "Host=lxc-db3;Port=5432;Database=wollmilchsau;Username=wollmilchsau;Password=rVx0EoLDOnld", - "RedisCache": "lxc-matrix:6379" + "Marten": "Host=lxc-db3.tail859cae.ts.net;Port=5432;Database=wollmilchsau;Username=wollmilchsau;Password=rVx0EoLDOnld", + "RedisCache": "lxc-matrix.tail859cae.ts.net:6379" }, "OIDC": { "Authority": "https://id.bs18.de/realms/master", @@ -48,7 +48,7 @@ } }, "LDAP": { - "LdapUri": "ldaps://212.12.36.11:10636", + "LdapUri": "ldaps://bs18-hh.de:10636", "BindPassword": "skMXHFyf3fjW4iJhsoEyfQdc0wYthuVs6xim7BKhX3c5EZSuPcRrYYiGonynBnHW", "BindDN": "cn=bs18ldap,ou=ldap,dc=bs18-hh,dc=de", "BaseDN": "dc=bs18-hh,dc=de",