Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-821

Connections failing when active in process with other code that uses OpenSSL

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.2-beta0, 1.1.10
    • Component/s: libmongoc
    • None
    • Environment:
      Tested on Ubuntu 14.04 64 bit.

      When trying to use the C driver (embedded in Rust via https://github.com/thijsc/mongo-rust-driver) together with other code that uses OpenSSL connections fail.

      Everything works up until initialization of an OpenSSL context by another library. Then the trace below happens and connections fail.

      Is this a bug in the Mongo C driver? Should we maybe be using SSL_CTX_get_ex_new_index for example to scope the callbacks to just the C driver itself?

      ```
      [2015-09-01T09:33:31][TRACE] mongoc: cursor - ENTRY: mongoc_cursor_more():875
      [2015-09-01T09:33:31][TRACE] mongoc: cursor - EXIT: mongoc_cursor_more():885
      [2015-09-01T09:33:31][TRACE] mongoc: cursor - ENTRY: mongoc_cursor_next():741
      [2015-09-01T09:33:31][TRACE] mongoc: cursor - TRACE: mongoc_cursor_next():746 cursor_id(0)
      [2015-09-01T09:33:31][TRACE] mongoc: cursor - ENTRY: _mongoc_cursor_next():777
      [2015-09-01T09:33:31][TRACE] mongoc: cursor - ENTRY: _mongoc_cursor_query():476
      [2015-09-01T09:33:31][TRACE] mongoc: cluster - ENTRY: _mongoc_cluster_reconnect():2537
      [2015-09-01T09:33:31][TRACE] mongoc: cluster - ENTRY: _mongoc_cluster_update_state():115
      [2015-09-01T09:33:31][TRACE] mongoc: cluster - EXIT: _mongoc_cluster_update_state():142
      [2015-09-01T09:33:31][TRACE] mongoc: cluster - ENTRY: _mongoc_cluster_reconnect_replica_set():2205
      [2015-09-01T09:33:31][DEBUG] mongoc: cluster - Reconnecting to replica set.
      [2015-09-01T09:33:31][TRACE] mongoc: cluster - ENTRY: _mongoc_cluster_clear_peers():208
      [2015-09-01T09:33:31][TRACE] mongoc: cluster - EXIT: _mongoc_cluster_clear_peers():216
      [2015-09-01T09:33:31][TRACE] mongoc: client - ENTRY: mongoc_client_connect_tcp():90
      [2015-09-01T09:33:31][TRACE] mongoc: socket - ENTRY: mongoc_socket_new():609
      [2015-09-01T09:33:31][TRACE] mongoc: socket - ENTRY: _mongoc_socket_setnodelay():182
      [2015-09-01T09:33:31][TRACE] mongoc: socket - EXIT: _mongoc_socket_setnodelay():194
      [2015-09-01T09:33:31][TRACE] mongoc: socket - EXIT: mongoc_socket_new():633
      [2015-09-01T09:33:31][TRACE] mongoc: socket - ENTRY: mongoc_socket_connect():472
      [2015-09-01T09:33:31][TRACE] mongoc: socket - ENTRY: _mongoc_socket_wait():123
      [2015-09-01T09:33:31][TRACE] mongoc: socket - EXIT: _mongoc_socket_wait():160
      [2015-09-01T09:33:31][TRACE] mongoc: socket - EXIT: mongoc_socket_connect():497
      [2015-09-01T09:33:31][WARN] mongoc: cluster - Failed connection to mongo1.staging:27017
      ```

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            thijs Thijs Cadier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: