1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/ext/puma_http11
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
..
org/jruby/puma Remove enable_SSLv3 support from JRuby 2015-05-01 16:49:48 -07:00
ext_help.h Allow compilation with -Werror=format-security option 2012-07-10 22:47:49 +00:00
extconf.rb Update extconf.rb to compile correctly on OS X 2014-12-19 20:51:00 -08:00
http11_parser.c Change parser symbol names to avoid clash. Fixes #179 2013-07-18 11:22:18 -07:00
http11_parser.h Define RSTRING_NOT_MODIFIED for Rubinius performance 2013-09-04 20:15:56 +02:00
http11_parser.java.rl Fix use of "unsafeBytes" leading to offset errors and regen parser. 2011-11-22 16:23:34 -06:00
http11_parser.rl Change parser symbol names to avoid clash. Fixes #179 2013-07-18 11:22:18 -07:00
http11_parser_common.rl Change parser symbol names to avoid clash. Fixes #179 2013-07-18 11:22:18 -07:00
io_buffer.c Define RSTRING_NOT_MODIFIED for Rubinius performance 2013-09-04 20:15:56 +02:00
mini_ssl.c ssl: Add Client Side Certificate Auth 2015-06-06 23:15:00 +02:00
puma_http11.c Increase the max URI path length to 2048 chars from 1024 chars 2013-11-10 00:16:30 -08:00
PumaHttp11Service.java Start java version of MiniSSL 2012-08-23 16:56:37 -07:00