commit 3b6f02c25957ab1d9e29d457f1804126d73e86d3 Author: A. Jesse Jiryu Davis Date: Wed Oct 28 15:52:30 2015 -0400 CDRIVER-935 use mongoc_uri_get_ssl New URI helper function simplifies mongoc_client_new. diff --git a/src/mongoc/mongoc-client.c b/src/mongoc/mongoc-client.c index 9902eea..786bb4e 100644 --- a/src/mongoc/mongoc-client.c +++ b/src/mongoc/mongoc-client.c @@ -727,15 +727,16 @@ _mongoc_client_new_from_uri (const mongoc_uri_t *uri, mongoc_topology_t *topolog mongoc_cluster_init (&client->cluster, client->uri, client); + if (mongoc_uri_get_ssl (client->uri)) { #ifdef MONGOC_ENABLE_SSL - options = mongoc_uri_get_options (client->uri); - - if (bson_iter_init_find (&iter, options, "ssl") && - BSON_ITER_HOLDS_BOOL (&iter) && - bson_iter_bool (&iter)) { - mongoc_client_set_ssl_opts (client, mongoc_ssl_opt_get_default ()); - } + mongoc_client_set_ssl_opts (client, mongoc_ssl_opt_get_default ()); +#else + MONGOC_ERROR ("Can't create SSL client, SSL is not enabled in this build" + " of mongo-c-driver."); + mongoc_client_destroy (client); + return NULL; #endif + } mongoc_counter_clients_active_inc ();