Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1163

Compiling with SSL support doesn't work

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.2.0-rc0
    • Affects Version/s: None
    • Component/s: Implementation
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Even when compiling libmongoc with SSL support, compiling the C++ driver and running code using SSL features fails.

      To reproduce:

      1. Compile/install libmongoc with SSL support
      2. Compile the C++ driver as usual
      3. Compile and run the following code:
      #include <bsoncxx/builder/basic/document.hpp>
      #include <bsoncxx/builder/basic/kvp.hpp>
      #include <bsoncxx/document/value.hpp>
      #include <bsoncxx/json.hpp>
      #include <iostream>
      #include <mongocxx/client.hpp>
      #include <mongocxx/database.hpp>
      #include <mongocxx/instance.hpp>
      #include <mongocxx/uri.hpp>
      #include <mongocxx/uri.hpp>
      
      using namespace mongocxx;
      using namespace bsoncxx::builder::basic;
      
      int main() {
        mongocxx::instance instance{};
      
        document builder{};
        builder.append(kvp("_isSelf", 1));
        bsoncxx::document::value is_self = builder.extract();
      
        {
          client client{uri{"mongodb://snitest1.10gen.cc:27777/?ssl=true"}};
          database db = client["test"];
          std::cout << "First output: "
                    << bsoncxx::to_json(db.run_command(is_self.view())) << std::endl;
        }
      
        {
          client client{uri{"mongodb://snitest2.mongodb.com:27777/?ssl=true"}};
          database db = client["test"];
          bsoncxx::document::value output = db.run_command(is_self.view());
      
          std::cout << "Second output: " << bsoncxx::to_json(output) << std::endl;
        }
      }
      

      The output will be something like this:

      libc++abi.dylib: terminating with uncaught exception of type mongocxx::v_noabi::exception: SSL support not available
      

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: