You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS client: connecting to an HTTPS (TLS) data server fails; server certificate on the client #1385
Reported on #1380 (2026-12-02): the macOS client has problems connecting to a data server over HTTPS. This path (TLS data server, port 8443, with the broker on 8883) has not been tested on macOS recently. One suspect is how the server's certificate gets to the client.
On Linux the client gets the certificate with sudo ecce-remote-setup <host> --tls --pin server.pem (or --fetch-pin), which writes <ECCE_HOME>/siteconfig/RemoteServer/server.pem. On macOS ECCE_HOME is inside /Applications/ECCE.app, so the pin is written into the app bundle. To check:
whether ecce-remote-setup --tls --pin / --fetch-pin succeeds on macOS and where the pin ends up;
Test on the released 9.6.1 x86_64 dmg, macOS 12.7.6 (Intel), client only. Server: 9.6.1 on Debian 13, ecce-remote-setup --server all --tls (self-signed RSA-3072 certificate), data server on 8443, broker on 8883.
1. ecce-remote-setup on macOS fails without ECCE_HOME
$ /Applications/ECCE.app/Contents/Resources/bin/ecce-remote-setup <server> --tls --pin server.pem
ecce-remote-setup: no siteconfig at /opt/ecce/siteconfig
Set ECCE_HOME to the installation you want to configure.
The script defaults to ECCE_HOME=/opt/ecce (packaging/dataserver/ecce-remote-setup, : "${ECCE_HOME:=/opt/ecce}"). The command is also not on PATH on macOS, so the documented sudo ecce-remote-setup <host> --tls --pin server.pem cannot work as written. With ECCE_HOME=/Applications/ECCE.app/Contents/Resources/ecce it works, and no sudo is needed when the user who copied the app into /Applications owns the bundle:
Central server: https://<server>:8443/Ecce
reachable
Copied the server's machine list: 3 machine(s) ...
Wrote:
.../ECCE.app/Contents/Resources/ecce/siteconfig/RemoteServer/DataServers
.../ECCE.app/Contents/Resources/ecce/siteconfig/RemoteServer/site_runtime
.../ECCE.app/Contents/Resources/ecce/siteconfig/RemoteServer/server.pem
2. The pinned connection works up to the login
ecce -remote (with Contents/Resources/bin on PATH) wrote the broker file with tls=1, cafile=.../siteconfig/RemoteServer/server.pem, pinned=1; the gateway's HTTPS requests reached the server (HEAD /Ecce 301, OPTIONS /Ecce 200, HEAD /Ecce/users 401, i.e. waiting for the login). A TLS handshake with that pin succeeds from the Mac on both 8443 and 8883 (TLS 1.3). The MQTT login after the data server login was not checked (it needs the password typed into the login window). --fetch-pin and the first-connection pinning from the Start window were not tried.
3. The pin lives inside the app bundle
codesign --verify --deep /Applications/ECCE.app already fails before any setup (a sealed resource is missing or invalid): the bundled Python writes __pycache__/*.pyc into Contents/Resources/python at run time. The setup adds four more file added: entries under siteconfig/RemoteServer. The app still started.
Replacing ECCE.app for an update deletes siteconfig/RemoteServer, so the server setting and the pin are lost and the setup has to be repeated.
4. Likely failure with a CA-signed certificate (--system-ca) on macOS (found in the code and binaries, not run)
The bundled Contents/Frameworks/libcrypto.3.dylib has OPENSSLDIR: "/Users/runner/ecce-deps/ssl" (the CI build path). Without a pin, CTLSClientSocket calls SSL_CTX_set_default_verify_paths (src/dsm/cipc/CTLSSocket.C), which then loads no CA certificates on a user's Mac. Every CA-signed server certificate would fail verification.
ecce-gateway-start picks capath=/etc/ssl/certs for the broker without a pin. On macOS that directory exists but is empty; the CA list is /etc/ssl/cert.pem.
Suggested fixes: default ECCE_HOME from the script's own location in ecce-remote-setup, and give the macOS command line instructions with the bundle path; on macOS, load /etc/ssl/cert.pem (or set SSL_CERT_FILE in the launcher) for the data server, and write cafile=/etc/ssl/cert.pem for the broker; keep the client's server setting and pin outside the bundle (for example /Library/Application Support/ECCE/RemoteServer, or ~/.ECCE/RemoteServer via --user) so that an update keeps them.
Still needed from the report: self-signed or CA certificate, how the client was set up, and the exact message.
I am working on a patch set that will allow each data server to have its own certificate that is loaded when the server is added. I had an issue that was causing a seg fault, but I am just testing a fix that would fix it.
With this, I should have portable configurations that can be e-mailed out to users that will set up the data server(s), compute machines (but not usernames or passwords) and available codes as a json file that is loaded in the preference screen.
Correction to item 1 above: Contents/Resources/bin/ecce-remote-setup is a wrapper that finds ECCE_HOME beside itself, so the /opt/ecce message came from running the inner script (Resources/ecce/bin/ecce-remote-setup) directly. Run through the wrapper, the script hits a different macOS bug:
$ /Applications/ECCE.app/Contents/Resources/bin/ecce-remote-setup --user <host>
Central server: http://<host>:8096/Ecce
.../ecce-remote-setup: line 461: CURL_TLS[@]: unbound variable
macOS /bin/bash is 3.2, where an empty array is "unbound" under set -u. Every plain-HTTP setup and every --system-ca setup stops here; only --pin/--fetch-pin got through, which is why the TLS test above worked.
ecce-remote-setup guards its array expansions (checked on macOS 12.7.6: the patched script reaches the server check).
ecce-gateway-start gives the broker cafile=/etc/ssl/cert.pem on macOS instead of the empty /etc/ssl/certs.
Left to the per-server certificate work in #1387, so the two don't collide in CTLSSocket.C: where the pin is stored (outside the app bundle) and the data-server side of --system-ca on macOS. The latter is SSL_CTX_set_default_verify_paths with the bundled libcrypto's OPENSSLDIR at the CI path, so no CA certificates load. Loading /etc/ssl/cert.pem on __APPLE__ when no pin is set would cover it.
The bash 3.2 fix for ecce-remote-setup and the macOS CA file for the broker are merged to main (aea0af7) after the TLS, first-start, site-setup and import tests passed. The pin location and the data-server CA on macOS stay with #1387.
Activity
ohlincha commentedon Dec 2, 2026
Test on the released 9.6.1 x86_64 dmg, macOS 12.7.6 (Intel), client only. Server: 9.6.1 on Debian 13,
ecce-remote-setup --server all --tls(self-signed RSA-3072 certificate), data server on 8443, broker on 8883.1.
ecce-remote-setupon macOS fails withoutECCE_HOMEThe script defaults to
ECCE_HOME=/opt/ecce(packaging/dataserver/ecce-remote-setup,: "${ECCE_HOME:=/opt/ecce}"). The command is also not on PATH on macOS, so the documentedsudo ecce-remote-setup <host> --tls --pin server.pemcannot work as written. WithECCE_HOME=/Applications/ECCE.app/Contents/Resources/ecceit works, and no sudo is needed when the user who copied the app into /Applications owns the bundle:2. The pinned connection works up to the login
ecce -remote(withContents/Resources/binon PATH) wrote the broker file withtls=1,cafile=.../siteconfig/RemoteServer/server.pem,pinned=1; the gateway's HTTPS requests reached the server (HEAD /Ecce301,OPTIONS /Ecce200,HEAD /Ecce/users401, i.e. waiting for the login). A TLS handshake with that pin succeeds from the Mac on both 8443 and 8883 (TLS 1.3). The MQTT login after the data server login was not checked (it needs the password typed into the login window).--fetch-pinand the first-connection pinning from the Start window were not tried.3. The pin lives inside the app bundle
codesign --verify --deep /Applications/ECCE.appalready fails before any setup (a sealed resource is missing or invalid): the bundled Python writes__pycache__/*.pycintoContents/Resources/pythonat run time. The setup adds four morefile added:entries undersiteconfig/RemoteServer. The app still started.siteconfig/RemoteServer, so the server setting and the pin are lost and the setup has to be repeated.4. Likely failure with a CA-signed certificate (
--system-ca) on macOS (found in the code and binaries, not run)Contents/Frameworks/libcrypto.3.dylibhasOPENSSLDIR: "/Users/runner/ecce-deps/ssl"(the CI build path). Without a pin,CTLSClientSocketcallsSSL_CTX_set_default_verify_paths(src/dsm/cipc/CTLSSocket.C), which then loads no CA certificates on a user's Mac. Every CA-signed server certificate would fail verification.ecce-gateway-startpickscapath=/etc/ssl/certsfor the broker without a pin. On macOS that directory exists but is empty; the CA list is/etc/ssl/cert.pem.Suggested fixes: default
ECCE_HOMEfrom the script's own location inecce-remote-setup, and give the macOS command line instructions with the bundle path; on macOS, load/etc/ssl/cert.pem(or setSSL_CERT_FILEin the launcher) for the data server, and writecafile=/etc/ssl/cert.pemfor the broker; keep the client's server setting and pin outside the bundle (for example/Library/Application Support/ECCE/RemoteServer, or~/.ECCE/RemoteServervia--user) so that an update keeps them.Still needed from the report: self-signed or CA certificate, how the client was set up, and the exact message.
matthewasplund commentedon Dec 2, 2026
I am working on a patch set that will allow each data server to have its own certificate that is loaded when the server is added. I had an issue that was causing a seg fault, but I am just testing a fix that would fix it.
With this, I should have portable configurations that can be e-mailed out to users that will set up the data server(s), compute machines (but not usernames or passwords) and available codes as a json file that is loaded in the preference screen.
ohlincha commentedon Dec 2, 2026
Correction to item 1 above:
Contents/Resources/bin/ecce-remote-setupis a wrapper that findsECCE_HOMEbeside itself, so the/opt/eccemessage came from running the inner script (Resources/ecce/bin/ecce-remote-setup) directly. Run through the wrapper, the script hits a different macOS bug:macOS
/bin/bashis 3.2, where an empty array is "unbound" underset -u. Every plain-HTTP setup and every--system-casetup stops here; only--pin/--fetch-pingot through, which is why the TLS test above worked.Branch
wip/1385-mac-setup(0bdd811):ecce-remote-setupguards its array expansions (checked on macOS 12.7.6: the patched script reaches the server check).ecce-gateway-startgives the brokercafile=/etc/ssl/cert.pemon macOS instead of the empty/etc/ssl/certs.Left to the per-server certificate work in #1387, so the two don't collide in
CTLSSocket.C: where the pin is stored (outside the app bundle) and the data-server side of--system-caon macOS. The latter isSSL_CTX_set_default_verify_pathswith the bundled libcrypto's OPENSSLDIR at the CI path, so no CA certificates load. Loading/etc/ssl/cert.pemon__APPLE__when no pin is set would cover it.Merge #1385: ecce-remote-setup under macOS bash 3.2; broker trusts th…
ohlincha commentedon Dec 3, 2026
The bash 3.2 fix for
ecce-remote-setupand the macOS CA file for the broker are merged to main (aea0af7) after the TLS, first-start, site-setup and import tests passed. The pin location and the data-server CA on macOS stay with #1387.