Checkout
Karl Fogel
committed
on 03 Jul 08
Resolve issue #2597: Add --trust-server-cert option to svn and svnsync,
so that non-interactive operations can work with (e.g.) self-signed… Show more
Resolve issue #2597: Add --trust-server-cert option to svn and svnsync,

so that non-interactive operations can work with (e.g.) self-signed

certificates not backed by a known trust authority.

Set up some shared infrastructure:

* subversion/include/svn_cmdline.h

 (svn_cmdline_setup_auth_baton): Deprecate, replace with...

 (svn_cmdline_set_up_auth_baton): ...this, which takes a new boolean

   parameter trust_server_cert.

* subversion/libsvn_subr/cmdline.c

 (ssl_trust_unknown_server_cert): New function.

 (svn_cmdline_setup_auth_baton): Just wrap below.

 (svn_cmdline_set_up_auth_baton): New function, based on above.  If

   both non_interactive and the new parameter trust_server_cert are

   true, then register ssl_trust_unknown_server_cert as a provider.

Add the new option to 'svn':

* subversion/svn/cl.h

 (svn_cl__opt_state_t): New boolean trust_server_cert.

* subversion/svn/main.c

 (svn_cl__options): Add new "trust-server-cert" option.

 (svn_cl__longopt_t): New opt_trust_server_cert enum.

 (svn_cl__global_options): Add opt_trust_server_cert to this list.

 (main): Parse the new option, do the expect things with the result.

Add the new option to 'svnsync':

* subversion/svnsync/main.c

 (svnsync_opt_trust_server_cert): New opt enum.

 (SVNSYNC_OPTS_DEFAULT, svnsync_options): List the new option.

 (struct opt_baton_t): New field trust_server_cert.

 (main): Parse the new option, do the expect things with the result.

Update the expected help output for the tests:

* subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout:

 Adjust for above.

Show less