diff -Nur cadaver-0.23.2/src/cadaver.c cadaver-new/src/cadaver.c --- cadaver-0.23.2/src/cadaver.c 2007-08-22 14:17:27.000000000 +0200 +++ cadaver-new/src/cadaver.c 2008-10-25 20:27:16.000000000 +0200 @@ -186,6 +186,8 @@ ident = ne_ssl_cert_identity(c); + int implicittrust = get_bool_option(opt_implicittrust); + if (ident) printf(_("WARNING: Untrusted server certificate presented for `%s':\n"), ident); @@ -207,12 +209,20 @@ ne_ssl_cert_validity(c, from, to); printf(_("Certificate is valid from %s to %s\n"), from, to); - if (isatty(STDIN_FILENO)) { - printf(_("Do you wish to accept the certificate? (y/n) ")); - return !yesno(); - } else { - printf(_("Certificate rejected.\n")); - return -1; + if(implicittrust) + { + printf(_("Certificate implicitly trusted.\n")); + return 0; + } + else + { + if (isatty(STDIN_FILENO)) { + printf(_("Do you wish to accept the certificate? (y/n) ")); + return !yesno(); + } else { + printf(_("Certificate rejected.\n")); + return -1; + } } } @@ -815,6 +825,7 @@ set_bool_option(opt_overwrite, 1); set_bool_option(opt_quiet, 1); set_bool_option(opt_searchall, 1); + set_bool_option(opt_implicittrust, 0); lockdepth = NE_DEPTH_INFINITE; lockscope = ne_lockscope_exclusive; searchdepth = NE_DEPTH_INFINITE; @@ -1136,6 +1147,13 @@ static int supply_creds_proxy(void *userdata, const char *realm, int attempt, char *username, char *password) { + if (get_option(opt_proxy_user) != NULL && get_option(opt_proxy_pass) != NULL && attempt-- == 0) + { + ne_strnzcpy(username, get_option(opt_proxy_user), NE_ABUFSIZ); + ne_strnzcpy(password, get_option(opt_proxy_pass), NE_ABUFSIZ); + return 0; + } + if (attempt > 1) return -1; diff -Nur cadaver-0.23.2/src/options.c cadaver-new/src/options.c --- cadaver-0.23.2/src/options.c 2004-10-10 22:53:02.000000000 +0200 +++ cadaver-new/src/options.c 2008-10-25 20:25:32.000000000 +0200 @@ -58,7 +58,7 @@ /* Option holders */ -static int enable_expect, presume_utf8, overwrite, quiet, searchall; +static int enable_expect, presume_utf8, overwrite, quiet, searchall, implicittrust; enum ne_lock_scope lockscope; int lockdepth; @@ -92,6 +92,7 @@ B(utf8, &presume_utf8, "Presume filenames etc are UTF-8 encoded"), B(quiet, &quiet, "Whether to display connection status messages"), B(searchall, &searchall, "Whether to search and display all props including dead props"), + B(implicittrust, &implicittrust, "Whether we implicitly trust the server's certificate"), #undef B #define S2(x,y, h) { x, y, NULL, opt_string, NULL, NULL, NULL, h, NULL } #define S(x,h) S2(#x, opt_##x, h) @@ -103,6 +104,8 @@ S(namespace, "Namespace to use for propset/propget commands."), S(pager, "Command to run for less/more commands."), S(proxy, "Hostname of proxy server"), + S(proxy_user, "Proxy server user name"), + S(proxy_pass, "Proxy server password"), S(searchorder, "Search ascending props options"), S(searchdorder, "Search descending props options"), { "proxy-port", opt_proxy_port, NULL, opt_string, NULL, NULL, NULL, diff -Nur cadaver-0.23.2/src/options.h cadaver-new/src/options.h --- cadaver-0.23.2/src/options.h 2004-10-10 22:53:02.000000000 +0200 +++ cadaver-new/src/options.h 2008-10-25 20:25:32.000000000 +0200 @@ -43,7 +43,12 @@ opt_searchdepth, opt_searchorder, opt_searchdorder, - opt_searchall + opt_searchall, + + opt_proxy_user, + opt_proxy_pass, + + opt_implicittrust }; extern int lockdepth; /* current lock depth setting. */