GNURLOPT_S...IC_KEY_MD5(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

✨ NAME ✨

Okay so this page is GNURLOPT_S...IC_KEY_MD5(3), from the curl_easy_setopt options manual, and the main-character option is CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 β€” checksum of SSH server public key. That's literally the whole name, bestie. πŸ’…

πŸ”‘ SYNOPSIS πŸ”‘

Here's the include and the function signature, exactly:

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
                          char *md5);

πŸ’– DESCRIPTION πŸ’–

Pass a char * pointing to a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote host's public key, and libcurl will reject the connection to the host unless the md5sums match. No cap, that's the whole vibe check. πŸ”βœ¨

The application does not have to keep the string around after setting this option. So you can let it go, bestie β€” it's not clingy. πŸ¦‹

🌸 DEFAULT 🌸

NULL β€” the default is just nothing, empty, no key checksum set. πŸ™ˆ

🌈 PROTOCOLS 🌈

SCP and SFTP. That's it, that's the list. πŸ’«

πŸŽ€ EXAMPLE πŸŽ€

Here's the example, copied exactly so you can steal it:

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
  curl_easy_setopt(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
                   "afe17cd62a0f3b61f1ab9cb22ba269a7");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Added in 7.17.1. Old-school but still iconic. πŸ‘‘

🫢 RETURN VALUE 🫢

  • CURLE_OK if the option is supported
  • CURLE_UNKNOWN_OPTION if not
  • CURLE_OUT_OF_MEMORY if there was insufficient heap space

πŸ‘€ SEE ALSO πŸ‘€

mwah πŸ’‹ β€” this page is from libcurl 7.37.0, dated 19 Jun 2014, and the footer says GNURLOPT_S...IC_KEY_MD5(3). k bye bestie 🫢

πŸ“¦ where this page comes from