module Unicorn::SSLConfigurator - Unicorn: Rack HTTP server for fast clients and Unix

# module Unicorn::SSLConfigurator

This module is included in Unicorn::Configurator

### Public Instance Methods

ssl() { || ... } click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 6
    def ssl(&block)
      ssl_require!
      before = @set[:listeners].dup
      opts = @set[:ssl_opts] = {}
      yield
      (@set[:listeners] - before).each do |address|
        (@set[:listener_opts][address] ||= {})[:ssl_opts] = opts
      end
      ensure
        @set.delete(:ssl_opts)
    end

ssl_certificate(file) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 18
    def ssl_certificate(file)
      ssl_set(:ssl_certificate, file)
    end

ssl_certificate_key(file) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 22
    def ssl_certificate_key(file)
      ssl_set(:ssl_certificate_key, file)
    end

ssl_ciphers(openssl_cipherlist_spec) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 34
    def ssl_ciphers(openssl_cipherlist_spec)
      ssl_set(:ssl_ciphers, openssl_cipherlist_spec)
    end

ssl_client_certificate(file) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 26
    def ssl_client_certificate(file)
      ssl_set(:ssl_client_certificate, file)
    end

ssl_compression(bool) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 74
    def ssl_compression(bool)
      # OpenSSL uses the SSL_OP_NO_COMPRESSION flag, Flipper follows suit
      # with :ssl_no_compression, but we negate it to avoid exposing double
      # negatives to the user.
      ssl_set(:ssl_no_compression, check_bool(:ssl_compression, ! bool))
    end

ssl_crl(file) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 38
    def ssl_crl(file)
      ssl_set(:ssl_crl, file)
    end

ssl_dhparam(file) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 30
    def ssl_dhparam(file)
      ssl_set(:ssl_dhparam, file)
    end

ssl_engine(engine) click to toggle source

Allows specifying an engine for OpenSSL to use. We have not been able to successfully test this feature due to a lack of hardware, Reports of success or patches to unicorn-public@bogomips.org is greatly appreciated.

    # File lib/unicorn/ssl_configurator.rb, line 66
    def ssl_engine(engine)
      ssl_warn_global(:ssl_engine)
      ssl_require!
      OpenSSL::Engine.load
      OpenSSL::Engine.by_id(engine)
      @set[:ssl_engine] = engine
    end

ssl_prefer_server_ciphers(bool) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 42
    def ssl_prefer_server_ciphers(bool)
      ssl_set(:ssl_prefer_server_ciphers, check_bool(bool))
    end

ssl_protocols(list) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 46
    def ssl_protocols(list)
      ssl_set(:ssl_protocols, list)
    end

ssl_session_timeout(seconds) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 54
    def ssl_session_timeout(seconds)
      ssl_set(:ssl_session_timeout, seconds)
    end

ssl_verify_client(on_off_optional) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 50
    def ssl_verify_client(on_off_optional)
      ssl_set(:ssl_verify_client, on_off_optional)
    end

ssl_verify_depth(depth) click to toggle source

    # File lib/unicorn/ssl_configurator.rb, line 58
    def ssl_verify_depth(depth)
      ssl_set(:ssl_verify_depth, depth)
    end