Sha256: 6a16839a22118167ff4aa315cfa3ad8f187061e92e641213529d9d8e8d322017

Contents?: true

Size: 936 Bytes

Versions: 30

Compression:

Stored size: 936 Bytes

Contents

require 'spec_helper'

require 'mcollective/monkey_patches'

describe OpenSSL::SSL::SSLContext do
  it 'sets parameters on initialization' do
    described_class.any_instance.expects(:set_params)
    subject
  end

  it 'disables SSLv2 via the SSLContext#options bitmask' do
    (subject.options & OpenSSL::SSL::OP_NO_SSLv2).should == OpenSSL::SSL::OP_NO_SSLv2
  end

  it 'explicitly disable SSLv2 ciphers using the ! prefix so they cannot be re-added' do
    cipher_str = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ciphers]
    cipher_str.split(':').should include('!SSLv2')
  end

  it 'has no ciphers with version SSLv2 enabled' do
    ciphers = subject.ciphers.select do |name, version, bits, alg_bits|
      /SSLv2/.match(version)
    end
    ciphers.should be_empty
  end

  it 'disables SSLv3 via the SSLContext#options bitmask' do
    (subject.options & OpenSSL::SSL::OP_NO_SSLv3).should == OpenSSL::SSL::OP_NO_SSLv3
  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mcollective-client-2.12.5 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.12.4 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.12.3 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.12.1 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.12.0 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.10.6 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.11.4 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.11.3 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.11.2 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.11.1 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.11.0 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.10.4 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.10.3 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.10.2 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.10.1 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.10.0 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.8.7 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.8.5 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.8.8 spec/unit/mcollective/monkey_patches_spec.rb
mcollective-client-2.8.6 spec/unit/mcollective/monkey_patches_spec.rb