1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/helpers/ssl.rb
Daniel Colson f5ccd03b26 Add SSL support for the control app (#2046)
* 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
2019-10-21 09:35:15 +08:00

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