From owner-freebsd-ports@freebsd.org Tue Jan 12 10:31:31 2021 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CB904D1D9B for ; Tue, 12 Jan 2021 10:31:31 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (mailserver.netfence.it [78.134.96.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailserver.netfence.it", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFRh224lGz4kKc for ; Tue, 12 Jan 2021 10:31:29 +0000 (UTC) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.local.netfence.it [10.1.2.18]) (authenticated bits=0) by soth.netfence.it (8.16.1/8.16.1) with ESMTPSA id 10CATqwO006881 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Tue, 12 Jan 2021 11:31:21 +0100 (CET) (envelope-from ml@netfence.it) X-Authentication-Warning: soth.netfence.it: Host alamar.local.netfence.it [10.1.2.18] claimed to be alamar.ventu From: Andrea Venturoli Subject: Occasional saslauthd LDAP failure To: freebsd-ports@freebsd.org Message-ID: <1d4589bd-d617-f355-d6d9-35cb74034fce@netfence.it> Date: Tue, 12 Jan 2021 11:29:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DFRh224lGz4kKc X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=netfence.it; spf=pass (mx1.freebsd.org: domain of ml@netfence.it designates 78.134.96.152 as permitted sender) smtp.mailfrom=ml@netfence.it X-Spamd-Result: default: False [-3.79 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[78.134.96.152:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:78.134.96.152]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[78.134.96.152:from:127.0.2.255]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[netfence.it,none]; NEURAL_HAM_SHORT(-0.99)[-0.992]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:35612, ipnet:78.134.0.0/17, country:IT]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-ports] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 10:31:31 -0000 Hello. I've got several services authenticating against a Samba AD DC via "saslauthd -a ldap" This works perfectly from the users' point of view. However I often find failures in the logs: > saslauthd[89676]: ldap_simple_bind() failed -1 (Can't contact LDAP server). > saslauthd[89676]: Retrying authentication This happens hundreds of times a day. Almost surely retrying succeeds, as no user ever complained. I tried getting some logs from Samba, but was not able to. I ran saslauthd in debug mode and, when the above happens, this is what I see: > TLS certificate verification: Error, unable to get local issuer certificate > TLS certificate verification: Error, unable to verify the first certificate Any hint? Why would either saslauthd or the openldap client library fail occasionally? Since I'm using a stateful firewall, I though perhaps connections time out, but disabling it did not help. My saslauthd.conf: > ldap_servers: ldap://x.x.x.x/ > ldap_bind_dn: cn=xxx,cn=Users,dc=xxx,dc=xxx,dc=xxx > ldap_password: XXXXXXXX > ldap_start_tls: yes > ldap_search_base: cn=Users,dc=xxx,dc=xxx,dc=xxx > ldap_tls_cert: /.../cert.pem > ldap_tls_key: /.../key.pem > ldap_filter: (sAMAccountName=%u) > ldap_scope: sub > ldap_debug: 100 > ldap_verbose: on > ldap_tls_check_peer: no > My ldap.conf: > TLS_CACERT /.../cert.pem > TLS_CERT /.../key.pem > TLS_REQCERT allow > ssl_check_cert off bye & Thanks av.