mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
f5ccd03b26
* Extract class for building SSL context This commit extracts the `MiniSSL::Context` creation into its own `MiniSSL::ContextBuilder` class along the same lines as in [#1989]. This will allow us to reuse this code for adding SSL support to the control app (issue [#2015]). Since we will need the `MiniSSL` require and check in both places, I moved that into the `ContextBuilder` class as well. [#1989]: https://github.com/puma/puma/pull/1989 [#2015]: https://github.com/puma/puma/pull/2015 * Add SSL support for the control app This starts to address [#2015]. I think we will need to add SSL support to the control cli as well. [#2015]: https://github.com/puma/puma/issues/2015
13 lines
549 B
Ruby
13 lines
549 B
Ruby
module SSLHelper
|
|
def ssl_query
|
|
@ssl_query ||= if Puma.jruby?
|
|
@keystore = File.expand_path "../../../examples/puma/keystore.jks", __FILE__
|
|
@ssl_cipher_list = "TLS_DHE_RSA_WITH_DES_CBC_SHA,TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"
|
|
"keystore=#{@keystore}&keystore-pass=pswd&ssl_cipher_list=#{@ssl_cipher_list}"
|
|
else
|
|
@cert = File.expand_path "../../../examples/puma/cert_puma.pem", __FILE__
|
|
@key = File.expand_path "../../../examples/puma/puma_keypair.pem", __FILE__
|
|
"key=#{@key}&cert=#{@cert}"
|
|
end
|
|
end
|
|
end
|