Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - boku

#1
Tutorials and FAQs / HAProxy for IMAP/S help needed
April 17, 2025, 08:49:54 AM
Hi All

I am struggling with the setup of HAProxy for IMAP/S (for HTTP, I use Caddy). In the HAProxy logs, all I can see is:

Informational   haproxy   Connect from <client IP>:61628 to <OPNsense WAN IP>:993 (public_imaps/TCP)

But my (MacOS Mail) client returns an error. I was told, that the issue is what I can see in the HAProxy config export:

backend pool_dms_imaps
    # health checking is DISABLED
    mode tcp
    balance source
    # stickiness
    stick-table type ip size 50k expire 30m 
    stick on src
    server dms_imaps <internal mail server name>:993 maxconn 100 ssl alpn h2,http/1.1 verify none send-proxy-v2 check-send-proxy

"alpn h2,http/1.1":
HAProxy, as I was told, somehow defaults to HTTP and that is why mail client access fails.

I use:
- Multiplexer Protocol = none in Real Server
- Mode = TCP in Backend Pool
- Type = TCP in Public Service

curl -vk https://<public DNS name>:993
* Host <public DNS name>:993 was resolved.
* IPv6: (none)
* IPv4: <OPNsense WAN IP>
*   Trying <OPNsense WAN IP>:993...
* Connected to <public DNS name> (<OPNsense WAN IP>) port 993
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=<public DNS name>
*  start date: Mar  3 22:03:37 2025 GMT
*  expire date: Jun  1 22:03:36 2025 GMT
*  issuer: C=US; O=Let's Encrypt; CN=R10
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://<public DNS name>:993/
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: <public DNS name>:993]
* [HTTP/2] [1] [:path: /]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [accept: */*]

To those using HAProxy for IMAP/S. Can you please share what you have configured differently or am I misguided by assuming that "alpn h2,http/1.1" is causing my issue? Can this setup be configured in the UI or only via some config includes via SSH? I couldn't find any hint on that.

Thank you, Patric
#2
Hallo zusammen

Eigentlich hatte ich gehofft, dass ich mit meiner ersten Frage unter General Discussions erfolgreicher bin. Nun ja, vielleicht ist sie entweder zu simple oder zu seltsam. Ich versuche es mal hier auf Deutsch und wäre den Sehenden unter Euch unglaublich dankbar für ein paar Tipps, wie ich dem Problem auf den Grund gehen kann.

Der ACME Client in der OPNsense (24.7.10_2) beschafft zuverlässig LE Zertifikate. Diese sollen intern weiterverteilt werden. Ich habe 2 Synology NAS Systeme (DSM DSM 7.2.2-72806) in unterschiedlichen VLANs. Bei einem funktioniert die Synology Automation ganz wunderbar, beim anderen nicht (s.u.). Ich habe auch erfolgreiche SFTP Automation mit dem jeweils selben Synology user getestet und komme auch von der OPNsense per SSH auf die Systeme. Meine Domäne ist öffentlich, die beiden NAS hostname sind aber nur im internen DNS (separater Container mit BIND9) bekannt.


2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] Error encountered while deploying.
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] Error deploying for domain: <host>.<domain>
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] Unable to authenticate to https://<host>.<domain>:5001, you may report this by providing full log with '--debug 3'.
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] SynoToken
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] Session ID
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] error_code
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] response
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] ret='60'
...
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] == Info: Host <host>.<domain>:5001 was resolved.
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] Here is the curl dump log:
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] _CURL='curl --silent --dump-header /var/etc/acme-client/home/http.header -L --trace-ascii /tmp/tmp.uMP3NA0rC9 -g '
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] wget exists=127
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] mktemp exists=0
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] curl exists=0
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] timeout=
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] url='https://<host>.<domain>:5001/webapi/?api=SYNO.API.Auth&version=&method=login&format=sid&account=nushi&passwd=%40aF32aggHXrtKU&enable_syno_token=yes'
2024-12-10T14:24:58   acme.sh   [Tue Dec 10 14:24:58 CET 2024] GET
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] _hex_str=' 40 61 46 33 32 61 67 67 48 58 72 74 4b 55'
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] _url_encode
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] od exists=0
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] _hex_str=' 6e 75 73 68 69'
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] _url_encode
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] od exists=0
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] Logging into <host>.<domain>:5001...
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] api_version
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] api_path
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] response
2024-12-10T14:24:57   acme.sh   [Tue Dec 10 14:24:57 CET 2024] ret='60'

Zwischenzeitlich habe ich das selbstsignierte Zertifikat des NAS ersetzt durch das LE Zertifikat, der Fehler ist aber noch derselbe. Viel zu rc 60 habe ich auch nicht gefunden - erst recht nicht, was genau das Problem ist

All I can find about return code 60 is this:
CURLE_PEER_FAILED_VERIFICATION (60): The remote server's SSL certificate or SSH fingerprint was deemed not OK. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its previous value was 51.

Vielen Dank für Eure Zeit!
Patric

PS: Noch eine Frage zur Proxmox Automation. Die funktioniert bei mir auch nicht trotz exit code 0. Im letzten Jahr gab es glaube ich einen Fehler, der aber doch sicherlich längst behoben ist. Funktioniert das aktuell bei jemanden von Euch?
#3
General Discussion / ACME client / Synology / CURL 60
December 08, 2024, 09:58:45 AM
Dear All

I am struggling with ACME client certification deployment to Synology. What is so strange to me is, that it works for one Synology NAS but not for the other.

My setup:
- OPNsense on 24.7.10_2
- 2 * Synology on DSM 7.2.2-72806
- Both NAS systems are in different VLANs
- SSH access is fine from OPNsense root to relevant NAS user

I have set Log Level to debug3 in ACME Client settings but I do not see more than the following.

My domain is public but the hostnames of these 2 NAS systems are not. I am running BIND9 as DNS for my local network

I successfully tested SFTP automation to both NAS systems with the same Synology users. OTP are not configured.



2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] Error encountered while deploying.
2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] Error deploying for domain: <host>.<domain>
2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] Unable to authenticate to https://<host>.<domain>:5001, you may report this by providing full log with '--debug 3'.
2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] SynoToken
2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] Session ID
2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] error_code
2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] response
2024-12-08T09:31:06   acme.sh   [Sun Dec 8 09:31:06 CET 2024] ret='60'

Meanwhile I manually uploaded the LE certificate and set it as standard cert (I also deleted the self signed Synology cert)

All I can find about return code 60 is this:
CURLE_PEER_FAILED_VERIFICATION (60): The remote server's SSL certificate or SSH fingerprint was deemed not OK. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its previous value was 51.

Any advice that helps me to identify the misconfiguration is highly appreciated.