Sha256: 555b8d5befe256e801d34bde1f321f68675a3e317a7022842b77a4b9824e69ae

Contents?: true

Size: 859 Bytes

Versions: 1

Compression:

Stored size: 859 Bytes

Contents

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_ssl

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

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo-2.9.0.rc0 spec/integration/ssl_uri_options_spec.rb