CURLOPT_SSH_KNOWNHOSTS.md: strongly recommend using this

Make setopt fail for SSH backends not supporting knownhosts or pub md5

Closes #16204
This commit is contained in:
Daniel Stenberg 2025-02-06 11:09:06 +01:00
parent 58674865fe
commit 3f7f180901
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 11 additions and 5 deletions

View file

@ -7,6 +7,7 @@ Source: libcurl
See-also:
- CURLOPT_SSH_AUTH_TYPES (3)
- CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 (3)
- CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 (3)
Protocol:
- SFTP
- SCP
@ -29,10 +30,14 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_KNOWNHOSTS, char *fname);
Pass a pointer to a null-terminated string holding the filename of the
known_host file to use. The known_hosts file should use the OpenSSH file
format as supported by libssh2. If this file is specified, libcurl only
accepts connections with hosts that are known and present in that file, with a
matching public key. Use CURLOPT_SSH_KEYFUNCTION(3) to alter the default
behavior on host and key matches and mismatches.
format. If this file is specified, libcurl only accepts connections with hosts
that are known and present in that file, with a matching public key. Use
CURLOPT_SSH_KEYFUNCTION(3) to alter the default behavior on host and key
matches and mismatches.
We strongly suggest users doing SCP or SFTP transfers to set this option to
make sure that the network communication is done with the intended server and
not an impostor.
The application does not have to keep the string around after setting this
option.