1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

31 commits

Author SHA1 Message Date
Nate Berkopec
696083162c
Parallelize a few more tests
Thanks to @MSP-Greg
2019-09-11 14:11:46 +00:00
MSP-Greg
08f8d1945d test/test_puma_server_ssl.rb - add Ruby OpenSSL version info (#1942)
Recent CI experimentation has shown system OpenSSL to be different than Ruby OpenSSL.  May cause testing issues.

Adds Ruby OpenSSL version info to test log by test_puma_server_ssl.rb when Minitest loads test files.
2019-09-02 07:16:14 +00:00
MSP-Greg
3b63963363 test_puma_server_ssl.rb - remove fixed port, add http.send :do_finish (#1932)
See:
https://travis-ci.org/puma/puma/jobs/576834408
2019-08-26 17:19:47 +00:00
MSP-Greg
a119661736 test_puma_server_ssl.rb - add tests for #no_tlsv1, #no_tlsv1_1 2019-08-03 14:55:53 -05:00
Jesús Burgos Maciá
39bc48f680 Avoid blocking on #read_nonblock
Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>
2019-07-30 17:08:44 -04:00
MSP-Greg
e04c030ac7 Update test skips, use next_port 2019-02-20 14:15:55 -06:00
Evan Phoenix
520870afa2
Merge pull request #1695 from olleolleolle/fix/avoid-warnings-in-test-suite
Avoid Ruby warnings
2019-02-20 09:27:27 -08:00
Evan Phoenix
8c5821017f
Merge pull request #1606 from MSP-Greg/test_ssl_v3_rejection
test_ssl_v3_rejection another error string
2019-02-19 17:10:30 -08:00
Olle Jonsson
fc9ddce98c Avoid Ruby warnings 2018-12-28 18:46:07 +01:00
MSP-Greg
f94db8d3b7 Update dev files - .travis.yml, .rubocop.yml, Gemfile 2018-09-11 16:31:54 -05:00
MSP-Greg
6a7112d51b Update test files
1. Update skip handling
2. Stability changes
3. Add Ruby & OpenSSL version info output
4. Bypassed SSL tests on DISABLE_SSL ?
2018-09-11 16:31:54 -05:00
MSP-Greg
26f5eef705 test_ssl_v3_rejection another error string
Found with Ruby 2.4.4 & OpenSSL 1.0.2o
2018-07-03 23:17:32 -05:00
David Rodríguez
4a7a9be7bd Fix ssl_v3_rejection test hanging (#1567)
* Fix ssl_v3_rejection test hanging

When closing the server, puma would get caught in a loop where it would
expect IO.select to timeout but instead it would return a file
descriptor ready to read, but in a end-of-file condition.

* Remove windows tweaks from test_puma_server_ssl.rb

So that the hang I'm getting when running the tests locally can be
reproduced.

* Add missing appveyor entry

* Try fix 2.2.9 build

* Fix extra package installation on appveyor
2018-05-09 12:30:22 -06:00
Richard Schneeman
1e69dac8a8
Merge branch 'master' into schneems/puma-stats 2018-03-20 12:14:13 -05:00
Vít Ondruch
7e932d0c50 Skip SSL tests instead silently passing them. (#1500)
If SSL is not used, the tests might be silently passing, while they are
not executed at all.
2018-03-20 11:12:43 -06:00
schneems
0d28652c3e Avoid hardcoding ports
When a test that boots a server fails it may not properly close out the port. When this happens there is a cascading failure as all other tests that use that port also fail. It becomes hard to find the actual failure reason. This commit uses a new number of every time port is used.
2018-03-20 11:25:26 -05:00
MSP-Greg
ba1ff107f6 test_puma_server_ssl.rb
Fixes to allow Appveyor (windows) testing to pass.
2018-03-19 18:37:32 -05:00
Eileen M. Uchitelle
6714214d57 Require puma/events in test helper (#1418)
Moves the require for puma/events from the individual test files and
into the main test helper.

The reason for this was while I was debugging the `test_puma_server.rb`
tests I was getting an error for an uninitialized constant for
`Puma::Event`.

Moving the require from the individual files to the test help means the
`puma/events` will always be included instead of having to remember to
do that. It makes debugging individual tests locally easier.
2017-09-23 05:44:21 +09:00
Michael Grosser
9d93a0f62f make test_helper no longer be loaded as a test (#1283)
running `rake` loads all files starting with `test_` which is not supposed to also load the helper,
since the helper should be loaded by each test and is not a test itself.
2017-05-12 12:16:55 -07:00
Michael Grosser
d25ef26465 warn when bundler fails and avoid having to use -I to run tests (#1270) 2017-04-11 14:48:11 -07:00
Francesco Rodriguez
cc4e8105dc Use Puma env detection helpers in tests. (#1156)
* Use Puma env detection helpers in tests.

* Check only once if environment is windows.

Same as #jruby?
2016-11-22 17:27:30 -07:00
Francesco Rodriguez
b638dd1948 Use Minitest instead of Test::Unit (#1152)
* Bump minitest version.

* Add basic test helper file.

* Use minitest for web server tests.

* Use Minitest for unix socket tests.

* Use Minitest for ThreadPool tests.

* Use Minitest for TCP-Rack tests

* Use Minitest for TCPLogger tests.

* Add missing helper to test helpers.

* Use Minitest for Rack server tests.

* Use Minitest for Rack handler tests.

* Use Minitest for Puma::Server tests.

* Use Minitest for Puma::Server with SSL tests.

* Use Minitest for persisten connections tests.

* Require puma in test_helper file.

* Use minitest for Puma::NullIO tests.

* Remove unnecessary requires on test files.

* Use Minitest for MiniSSL tests.

* Use Minitest for IOBuffer tests.

* Require bundler/setup in Rakefile.

* Use Minitest for HttpParser tests.

* Use Minitest for Puma::Configuration tests.

* Use Minitest for Puma::CLI tests.

* Bump Minitest version for Ruby 2.1 Gemfile.

* Use Minitest for integration tests.

* Use Minitest for Puma::App::Status tests.

* Remove test-unit from Gemfiles.

* Add timeout helper to Minitest::Test.

* Use Minitest for Puma::Binder tests.

* Remove testhelp file.

* Add missing require to Puma::Binder tests.

* Prefer require instead of require_relative.
2016-11-22 08:05:49 -07:00
Francesco Rodriguez
69710ab4a4 Remove support for 1.8.7 and 1.9.2. 2016-09-01 23:58:15 +02:00
joe miller
4ae0de4f4c support TLS client auth (verify_mode) in jruby
Adds support for `verify_mode` to configure client authentication when running under JRuby.

Things to note:

- Assumes the CA used to verify client certs is in the same java
  keystore file that is used when setting up the HTTPS TLS listener. We
could split this out, but not sure if it's necessary.
- Friendly/helpful error messages explaining why the verification failed
  are not present in the same way they are in the CRuby/OpenSSL code
path. I'm not sure how to make them available.
- I did not include any code to create the `keystore.jks` file in the
  `examples/puma/client-certs` directory because I didn't see any
existing code to create the `examples/puma/keystore.jks` file. The
commands to create this keystore would be:

```
cd examples/puma/client-certs
  openssl pkcs12 -chain -CAfile ./ca.crt -export -password pass:blahblah -inkey server.key -in server.crt -name server -out server.p12
  keytool -importkeystore -srckeystore server.p12 -srcstoretype pkcs12 -srcstorepass blahblah -destkeystore keystore.jks -deststoretype JKS -storepass blahblah
  keytool -importcert -alias ca -noprompt -trustcacerts -file ca.crt -keystore keystore.jks -storepass blahblah
```
2015-11-28 18:17:01 -08:00
Evan Phoenix
d421a53825 Disable SSL tests when SSL isn't used 2015-11-06 11:00:58 -08:00
Brian Shirai
d45584e716 Wrap SSLv3 spec in version guard. 2015-07-31 12:51:07 -07:00
Julian Langschaedel
e8d25b30f3 ssl: Add Client Side Certificate Auth
Add Client Side Certificate Auth feature and handling to puma's MiniSSL. Also exposes SSL errors to puma/apps.

 compatibility notes: MRI only

 shell example:

   puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&ca=path_to_ca&verify_mode=force_peer'

 code example: (examples/client_side_ssl)

    app = proc {|env| p env['puma.peercert']; [200, {}, ["hey"]] }

    events = SSLEvents.new($stdout, $stderr)
    server = Puma::Server.new(app, events)

    admin_context             = Puma::MiniSSL::Context.new
    admin_context.key         = KEY_PATH
    admin_context.cert        = CERT_PATH
    admin_context.ca          = CA_CERT_PATH
    admin_context.verify_mode = Puma::MiniSSL::VERIFY_PEER | Puma::MiniSSL::VERIFY_FAIL_IF_NO_PEER_CERT

    server.add_ssl_listener("0.0.0.0", ADMIN_PORT, admin_context)
    server.min_threads = MIN_THREADS
    server.max_threads = MAX_THREADS
    server.persistent_timeout = IDLE_TIMEOUT
    server.run.join

 additional credits: Andy Alness <andy.alness@gmail.com>
2015-06-06 23:15:00 +02:00
Daniel Marcotte
abcce826d1 Remove enable_SSLv3 support from JRuby
The C implementation has not supported SSLv3 at all since #591, and
SSLv3 is disabled by default in java now
(http://www.oracle.com/technetwork/java/javase/documentation/cve-2014-3566-2342133.html)
so we can drop support from JRuby.
2015-05-01 16:49:48 -07:00
Daniel Marcotte
6995981303 Fix hang on bad SSL handshake
Both the C and JRuby SSL implementations would hang on a bad handshake
because they were not producing the EOF expected in that case.
Update their error handling to behave correctly here (note:
`test_ssl_v3_rejection` covers this).
2015-05-01 16:39:22 -07:00
Daniel Marcotte
8eee16d445 JRuby SSL POODLE update
Default SSLv3 to disabled in response to the POODLE vulnerability.
2014-10-15 20:04:58 -07:00
Daniel Marcotte
c54807700c Add SSL support for JRuby
- Implement MiniSSL for JRuby

- Modify `Binder` and `MiniSSL::Context` to to accommodate the fact
that Java SSL demands a java keystore rather than a key/cert pair

- Change the MiniSSL native extension interface to take a
`MiniSSL::Context` rather than a key/cert pair so that each extension
can grab keys off the context as appropriate
2014-05-05 14:30:15 -07:00