Class: WEBrick::GenericServer
- Inherits:
-
Object
- Object
- WEBrick::GenericServer
- Defined in:
- lib/smart_proxy_dynflow_core/webrick-patch.rb
Instance Method Summary collapse
-
#setup_ssl_context(config) ⇒ Object
rubocop:disable Metrics/AbcSize.
Instance Method Details
#setup_ssl_context(config) ⇒ Object
rubocop:disable Metrics/AbcSize
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/smart_proxy_dynflow_core/webrick-patch.rb', line 10 def setup_ssl_context(config) # :nodoc: unless config[:SSLCertificate] cn = config[:SSLCertName] comment = config[:SSLCertComment] cert, key = Utils.create_self_signed_cert(1024, cn, comment) config[:SSLCertificate] = cert config[:SSLPrivateKey] = key end ctx = OpenSSL::SSL::SSLContext.new ctx.set_params ctx.ciphers = (CIPHERS - SmartProxyDynflowCore::Settings.instance.ssl_disabled_ciphers).join(':') ctx.key = config[:SSLPrivateKey] ctx.cert = config[:SSLCertificate] ctx.client_ca = config[:SSLClientCA] ctx.extra_chain_cert = config[:SSLExtraChainCert] ctx.ca_file = config[:SSLCACertificateFile] ctx.ca_path = config[:SSLCACertificatePath] ctx.cert_store = config[:SSLCertificateStore] ctx.tmp_dh_callback = config[:SSLTmpDhCallback] ctx.verify_mode = config[:SSLVerifyClient] ctx.verify_depth = config[:SSLVerifyDepth] ctx.verify_callback = config[:SSLVerifyCallback] ctx.timeout = config[:SSLTimeout] ctx. |= config[:SSLOptions] unless config[:SSLOptions].nil? ctx end |