Repository navigation
Conversation
Peer requests made by the cluster log download are verified with the JVM's default trust store and hostname check, and collecting logs no longer changes JVM-wide HTTP client properties. CLUSTER_LOG_DOWNLOAD_SCHEME selects plain HTTP only when set to http; any other value, or none, uses HTTPS, and a failed peer request is not retried with another scheme.
The _errors.txt entry of a failed peer now gives the HTTP status the peer answered with, or says the connection failed. The note naming CLUSTER_LOG_DOWNLOAD_SCHEME is added only to connection failures over HTTPS. The integration test restores the configuration values it changes.
The _errors.txt entry of a peer that could not be reached now says whether no connection was made, the TLS handshake failed, the request timed out, or the connection failed otherwise. The note naming CLUSTER_LOG_DOWNLOAD_SCHEME is left out when no connection was made, since the scheme makes no difference there.
…load A peer that does not finish connecting is reported as "connect timed out" and keeps the CLUSTER_LOG_DOWNLOAD_SCHEME note; a download that times out after connecting is reported as "timed out" without it.
Adds unit tests for a peer that answers after the request timeout and for a peer that closes the connection under the http scheme.
|
Claude finished @oidacra's task in 2m 26s —— View job PR Review: verify peer certificates in the cluster log download
I reviewed the diff against the prior state of these files. The change correctly implements what the reviewer (@wezell) asked for: port is configurable and defaults to 8443 ( Correctness notes (verified, no action needed)
Non-blocking observations (pre-existing, not introduced here)
No blocking issues found — the reviewer's two requests (configurable port defaulting to 8443, accept untrusted certs while keeping TLS) are both satisfied, and the implementation is sound. |
wezell
left a comment
There was a problem hiding this comment.
This is no going to work. dotCMS secure port is 8443, not 443 and each dotCMS uses a self signed cert that is not going to pass verification.
- Make the port configurable and default to 8443
- Allow untrusted certs.
This will secure the output. Maybe the endpoint on the receiving server should add
wezell
left a comment
There was a problem hiding this comment.
This is no going to work. dotCMS secure port is 8443, not 443 and each dotCMS uses a self signed cert that is not going to pass verification.
Instead, we should
- Make the port configurable and default to 8443
- Allow untrusted certs.
This will secure the output.
|
Done.
|
…ster log download Peer requests now go to CLUSTER_LOG_DOWNLOAD_PORT — 8443 by default under HTTPS, the local server's own port under plain HTTP — and accept the peer certificate without verification by default, through a trust-all manager scoped to the collector's own client: no JVM-wide hostname-verification property, no plaintext fallback. CLUSTER_LOG_DOWNLOAD_VERIFY_PEER_CERTS=true restores verification against the JVM trust store.
Change risk: Medium. Peer requests in the "All Cluster Nodes" download now go over HTTPS to
CLUSTER_LOG_DOWNLOAD_PORT— 8443 by default — and accept self-signed peer certificates. Clusters serving HTTPS on another port setCLUSTER_LOG_DOWNLOAD_PORT; clusters whose nodes talk to each other over plain HTTP setCLUSTER_LOG_DOWNLOAD_SCHEME=http.Where to look
ClusterLogCollector: oneHttpClientper collection. By default it uses a trust-allSSLContextscoped to that client alone — no JVM-widejdk.internal.httpclient.*property is set — so peers with self-signed certificates work and the peer token and logs still travel TLS-encrypted.CLUSTER_LOG_DOWNLOAD_VERIFY_PEER_CERTS=trueswitches to the JVM's default trust store with host name verification.resolveScheme): HTTPS by default; plain HTTP only whenCLUSTER_LOG_DOWNLOAD_SCHEMEishttp(trimmed, any case).auto, empty or unknown values mean HTTPS, and a failed HTTPS request is no longer retried over HTTP.resolvePeerPort):CLUSTER_LOG_DOWNLOAD_PORTwhen set; otherwise 8443 under HTTPS, or the local server's port under plain HTTP._errors.txtin the ZIP: each failed peer has a short reason (HTTP <status>,could not connect,TLS handshake failed,connect timed out,timed out,connection failed,request failed). Failures that may come from TLS also nameCLUSTER_LOG_DOWNLOAD_PORTandCLUSTER_LOG_DOWNLOAD_SCHEME.CLUSTER_LOG_DOWNLOAD_PORTandCLUSTER_LOG_DOWNLOAD_SCHEME=http.Proposed Changes
CLUSTER_LOG_DOWNLOAD_PORT(8443 by default; the local server's port under plain HTTP).CLUSTER_LOG_DOWNLOAD_VERIFY_PEER_CERTS=trueverifies certificates and host names against the JVM trust store. No JVM-wide HTTP client property is set either way.CLUSTER_LOG_DOWNLOAD_SCHEME=http, with no automatic retry between schemes._errors.txtentry of a failed peer says why it failed and, when the failure may be TLS related, which port and scheme settings control it.MaintenanceResource#downloadClusterLogFileJavadoc updated to the new port, scheme and certificate rules.Release note
The "All Cluster Nodes" log download now reaches the other nodes over HTTPS by default, on the port given by
CLUSTER_LOG_DOWNLOAD_PORT(8443 by default; envDOT_CLUSTER_LOG_DOWNLOAD_PORT). Peer certificates are accepted without verification, so clusters with self-signed certificates work out of the box; setCLUSTER_LOG_DOWNLOAD_VERIFY_PEER_CERTStotrue(envDOT_CLUSTER_LOG_DOWNLOAD_VERIFY_PEER_CERTS) to verify peers against the JVM trust store. Clusters whose nodes serve HTTPS on a different port setCLUSTER_LOG_DOWNLOAD_PORTto it; clusters whose nodes talk to each other over plain HTTP must setCLUSTER_LOG_DOWNLOAD_SCHEME=http(for exampleDOT_CLUSTER_LOG_DOWNLOAD_SCHEME=http). Each unreachable peer is listed in_errors.txtwith the reason and the settings that control it. The valueautois no longer special and means HTTPS.Checklist
ClusterLogCollectorPeerRequestTest(25 cases, local HTTP/HTTPS peers with runtime-generated certificates): scheme selection, peer port defaults and override, certificate acceptance by default, verification withCLUSTER_LOG_DOWNLOAD_VERIFY_PEER_CERTS, per-failure reasons, no JVM-wide properties.ClusterLogCollectorTest(MainSuite2b): plain-HTTP path unchanged;finallyrestores the previousConfigvalues.Additional Info
No REST contract change: same endpoint, same ZIP layout; only the free-text lines of
_errors.txtchange. No database, index or UI change.Fixes dotCMS/private-issues#903