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

Compiling with SSL support doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0-rc0
    • Component/s: Implementation
    • Labels:
      None
    • Sprint:
      Perl/CXX 2016-12-23

      Description

      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
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: