oscerd opened a new pull request, #28215: URL: https://github.com/apache/camel/pull/28215
Backport of #27821 onto `camel-4.22.x`. **Original PR:** #27821 - CAMEL-25644: camel-ssh - match known_hosts entries by exact host pattern **Target branch:** `camel-4.22.x` [CAMEL-25644](https://issues.apache.org/jira/browse/CAMEL-25644) ## What it does As on main, when `knownHostsResource` is set, `ResourceBasedSSHKeyVerifier` matches the entries of the `known_hosts` resource as OpenSSH does: - Each host pattern is compared, ignoring case, with the host the client connects to: the host configured on the endpoint, or the `HostName` that `~/.ssh/config` gives for it, never resolved through DNS. It is written `host` for port 22 and `[host]:port` for another port. The producer and the consumer resolve the host configuration once per connection and hand it to the verifier. - `*` and `?` are wildcards, `!` excludes the hosts a pattern matches, and hashed `|1|` entries are supported. - Every entry for the host is considered, and the keys are compared with Apache MINA SSHD. - A key in a matching `@revoked` entry is rejected, and so is a key that none of the entries of a listed host has, whatever the value of `failOnUnknownHost`. `@cert-authority` entries are ignored. - A resource or a line that cannot be read makes every connection fail. - `ssh-component.adoc` has the new "Server host key verification" section. ## Straight cherry-pick The diff is the diff of #27821 without its three upgrade guide files, which live on main only. The note for this branch is already on main, in the "Upgrading from 4.22.2 to 4.22.3" section of the 4.22 guide (4.22.2 has been tagged). The other 16 files are line for line the same as in #27821, including the regenerated catalog JSON and doc mirror and the component and endpoint DSL builders. As a straight backport of a reviewed PR, it has no reviewers. ## Tests - camel-ssh: 74 tests, 0 failures, none skipped (the IPv6 cases ran). - A full reactor build of the branch: `mvn clean install -DskipTests -DskipITs`, BUILD SUCCESS, 684 modules, nothing regenerated. _Claude Code on behalf of Andrea Cosentino_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
