Sha256: eb6b4afd2b963606eae6cf996e0d9ac22eac39d99be6091d6895fe9f9f24ff98

Contents?: true

Size: 905 Bytes

Versions: 9

Compression:

Stored size: 905 Bytes

Contents

# frozen_string_literal: true
# rubocop:todo all

require 'spec_helper'

describe 'SSL connections with URI options' do
  # SpecConfig currently creates clients exclusively through non-URI options.
  # Because we don't currently have a way to create what the URI would look
  # like for a given client, it's simpler just to test the that TLS works when
  # configured from a URI on a standalone server without auth required, since
  # that allows us to build the URI more easily.
  require_no_auth
  require_topology :single
  require_tls

  let(:hosts) do
    SpecConfig.instance.addresses.join(',')
  end

  let(:uri) do
    "mongodb://#{hosts}/?tls=true&tlsInsecure=true&tlsCertificateKeyFile=#{SpecConfig.instance.client_pem_path}"
  end

  it 'successfully connects and runs an operation' do
    client = new_local_client(uri)
    expect { client[:foo].count_documents }.not_to raise_error
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
mongo-2.21.0 spec/integration/ssl_uri_options_spec.rb
mongo-2.20.1 spec/integration/ssl_uri_options_spec.rb
mogno-2.20.0 spec/integration/ssl_uri_options_spec.rb
mogno-1.0.0 spec/integration/ssl_uri_options_spec.rb
mongo-2.20.0 spec/integration/ssl_uri_options_spec.rb
mongo-2.19.3 spec/integration/ssl_uri_options_spec.rb
mongo-2.19.2 spec/integration/ssl_uri_options_spec.rb
mongo-2.19.1 spec/integration/ssl_uri_options_spec.rb
mongo-2.19.0 spec/integration/ssl_uri_options_spec.rb