diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-05-10 09:17:37 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-05-10 09:17:37 -0700 |
| commit | bf8f2167fd3107f5513d487a69a6568cf51afd68 (patch) | |
| tree | fe1e3fda9d4a8cb105a6e562099ea14bc913e617 /ovsdb | |
| parent | be55976089659d082834aae58acd1173f10004e7 (diff) | |
| download | openvswitch-bf8f2167fd3107f5513d487a69a6568cf51afd68.tar.gz | |
stream-ssl: Improve messages when configuring SSL if it is unsupported.
Previously, if --private-key or another option that requires SSL support
was used, but OVS was built without OpenSSL support, then OVS would fail
with an error message that the specified option was not supported. This
confused users because it made them think that the option had been removed:
http://openvswitch.org/pipermail/discuss/2011-April/005034.html
This commit improves the error message: OVS will now report that it was
built without SSL support. This should be make the problem clear to users.
Reported-by: Aaron Rosen <arosen@clemson.edu>
Feature #5325.
Diffstat (limited to 'ovsdb')
| -rw-r--r-- | ovsdb/ovsdb-client.c | 6 | ||||
| -rw-r--r-- | ovsdb/ovsdb-server.c | 8 |
2 files changed, 2 insertions, 12 deletions
diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index a66b013bf..e8afdd6b3 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -80,9 +80,9 @@ parse_options(int argc, char *argv[]) DAEMON_LONG_OPTIONS, #ifdef HAVE_OPENSSL {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT}, - TABLE_LONG_OPTIONS, - STREAM_SSL_LONG_OPTIONS + STREAM_SSL_LONG_OPTIONS, #endif + TABLE_LONG_OPTIONS, {0, 0, 0, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -111,13 +111,11 @@ parse_options(int argc, char *argv[]) TABLE_OPTION_HANDLERS(&table_style) -#ifdef HAVE_OPENSSL STREAM_SSL_OPTION_HANDLERS case OPT_BOOTSTRAP_CA_CERT: stream_ssl_set_ca_cert_file(optarg, true); break; -#endif case '?': exit(EXIT_FAILURE); diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index c9b0fdd95..14f0fbfb7 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -51,13 +51,11 @@ VLOG_DEFINE_THIS_MODULE(ovsdb_server); -#if HAVE_OPENSSL /* SSL configuration. */ static char *private_key_file; static char *certificate_file; static char *ca_cert_file; static bool bootstrap_ca_cert; -#endif static unixctl_cb_func ovsdb_server_exit; static unixctl_cb_func ovsdb_server_compact; @@ -598,13 +596,11 @@ reconfigure_from_db(struct ovsdb_jsonrpc_server *jsonrpc, ovsdb_jsonrpc_server_set_remotes(jsonrpc, &resolved_remotes); shash_destroy_free_data(&resolved_remotes); -#if HAVE_OPENSSL /* Configure SSL. */ stream_ssl_set_key_and_cert(query_db_string(db, private_key_file), query_db_string(db, certificate_file)); stream_ssl_set_ca_cert_file(query_db_string(db, ca_cert_file), bootstrap_ca_cert); -#endif } static void @@ -671,12 +667,10 @@ parse_options(int argc, char *argv[], char **file_namep, DAEMON_LONG_OPTIONS, VLOG_LONG_OPTIONS, LEAK_CHECKER_LONG_OPTIONS, -#ifdef HAVE_OPENSSL {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT}, {"private-key", required_argument, 0, 'p'}, {"certificate", required_argument, 0, 'c'}, {"ca-cert", required_argument, 0, 'C'}, -#endif {0, 0, 0, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -714,7 +708,6 @@ parse_options(int argc, char *argv[], char **file_namep, DAEMON_OPTION_HANDLERS LEAK_CHECKER_OPTION_HANDLERS -#ifdef HAVE_OPENSSL case 'p': private_key_file = optarg; break; @@ -732,7 +725,6 @@ parse_options(int argc, char *argv[], char **file_namep, ca_cert_file = optarg; bootstrap_ca_cert = true; break; -#endif case '?': exit(EXIT_FAILURE); |
