1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
5Section: 3
6Source: libcurl
7See-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)
12Protocol:
13  - SFTP
14  - SCP
15---
16
17# NAME
18
19CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 - MD5 checksum of SSH server public key
20
21# SYNOPSIS
22
23~~~c
24#include <curl/curl.h>
25
26CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
27                          char *md5);
28~~~
29
30# DESCRIPTION
31
32Pass a char pointer pointing to a string containing 32 hexadecimal digits. The
33string should be the 128 bit MD5 checksum of the remote host's public key, and
34libcurl aborts the connection to the host unless the MD5 checksum match.
35
36MD5 is a weak algorithm. We strongly recommend using
37CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256(3) instead.
38
39The application does not have to keep the string around after setting this
40option.
41
42# DEFAULT
43
44NULL
45
46# EXAMPLE
47
48~~~c
49int main(void)
50{
51  CURL *curl = curl_easy_init();
52  if(curl) {
53    CURLcode res;
54    curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
55    curl_easy_setopt(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
56                     "afe17cd62a0f3b61f1ab9cb22ba269a7");
57    res = curl_easy_perform(curl);
58    curl_easy_cleanup(curl);
59  }
60}
61~~~
62
63# AVAILABILITY
64
65Added in 7.17.1
66
67# RETURN VALUE
68
69Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
70CURLE_OUT_OF_MEMORY if there was insufficient heap space.
71