CURLOPT_SSH_HOST_PUBLIC_KEY_MD5.md (1745B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 5 Section: 3 6 Source: libcurl 7 See-also: 8 - CURLOPT_SSH_AUTH_TYPES (3) 9 - CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 (3) 10 - CURLOPT_SSH_KNOWNHOSTS (3) 11 - CURLOPT_SSH_PUBLIC_KEYFILE (3) 12 Protocol: 13 - SFTP 14 - SCP 15 Added-in: 7.17.1 16 --- 17 18 # NAME 19 20 CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 - MD5 checksum of SSH server public key 21 22 # SYNOPSIS 23 24 ~~~c 25 #include <curl/curl.h> 26 27 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, 28 char *md5); 29 ~~~ 30 31 # DESCRIPTION 32 33 Pass a char pointer pointing to a string containing 32 hexadecimal digits. The 34 string should be the 128 bit MD5 checksum of the remote host's public key, and 35 libcurl aborts the connection to the host unless the MD5 checksum match. 36 37 MD5 is a weak algorithm. We strongly recommend using 38 CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256(3) instead. 39 40 The application does not have to keep the string around after setting this 41 option. 42 43 Using this option multiple times makes the last set string override the 44 previous ones. Set it to NULL to disable its use again. 45 46 # DEFAULT 47 48 NULL 49 50 # %PROTOCOLS% 51 52 # EXAMPLE 53 54 ~~~c 55 int main(void) 56 { 57 CURL *curl = curl_easy_init(); 58 if(curl) { 59 CURLcode res; 60 curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file"); 61 curl_easy_setopt(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, 62 "afe17cd62a0f3b61f1ab9cb22ba269a7"); 63 res = curl_easy_perform(curl); 64 curl_easy_cleanup(curl); 65 } 66 } 67 ~~~ 68 69 # %AVAILABILITY% 70 71 # RETURN VALUE 72 73 curl_easy_setopt(3) returns a CURLcode indicating success or error. 74 75 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 76 libcurl-errors(3).