char *libcurl; /* Output libcurl code to this filename */
char *ssl_sessions; /* file to load/save SSL session tickets */
char *help_category; /* The help category, if set */
+ char *knownhosts; /* known host path, if set. curl_free()
+ this */
struct tool_var *variables;
struct OperationConfig *first;
struct OperationConfig *current;
my_setopt(curl, CURLOPT_SSH_COMPRESSION, 1L);
if(!config->insecure_ok) {
- char *known = findfile(".ssh/known_hosts", FALSE);
+ char *known = global->knownhosts;
+
+ if(!known)
+ known = findfile(".ssh/known_hosts", FALSE);
if(known) {
/* new in curl 7.19.6 */
result = res_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, known);
- curl_free(known);
- if(result == CURLE_UNKNOWN_OPTION)
- /* libssh2 version older than 1.1.1 */
- result = CURLE_OK;
- if(result)
+ if(result) {
+ global->knownhosts = NULL;
+ curl_free(known);
return result;
+ }
+ /* store it in global to avoid repeated checks */
+ global->knownhosts = known;
+ }
+ else if(!config->hostpubmd5 && !config->hostpubsha256) {
+ errorf(global, "Couldn't find a known_hosts file");
+ return CURLE_FAILED_INIT;
}
else
warnf(global, "Couldn't find a known_hosts file");
}
varcleanup(global);
+ curl_free(global->knownhosts);
return result;
}
Refuse tunneling protocols through HTTP proxy
</name>
<command>
--x http://%HOSTIP:%PROXYPORT/%TESTNUMBER -p gopher://127.0.0.1 dict://127.0.0.1 http://moo https://example telnet://another ftp://yes ftps://again imap://more ldap://perhaps mqtt://yes pop3://mail rtsp://harder scp://copy sftp://files smb://wird smtp://send
+-x http://%HOSTIP:%PROXYPORT/%TESTNUMBER -p gopher://127.0.0.1 dict://127.0.0.1 http://moo https://example telnet://another ftp://yes ftps://again imap://more ldap://perhaps mqtt://yes pop3://mail rtsp://harder scp://copy sftp://files smb://wird smtp://send -k
</command>
</client>