Webrick SSL certificate authentication in Ramaze

86 views
Skip to first unread message

Davor Serfez

unread,
Mar 17, 2012, 7:38:14 PM3/17/12
to ram...@googlegroups.com
Hi,
I'm a Ruby/Ramaze noob, but found it is quite easy to write simple web apps and find it really a great product.
I would like to use webrick to serve a simple Ramaze app over SSL and to authenticate clients with certificates.
There are examples on the internetz on how to configure webrick for that, but couldn't find any mention on how to implement in Ramaze/Rack.
I guess the SSL configuration for webrick has to be integrated somewhere around in config.ru or start.rb, but besides that I'm clueless.

Any help is appreciated.

SSL with cert auth works like a charm with Apache, and I can get certificate information in the app from 'request.env' (to use in the app for authorization), but webrick is already there with ruby/ramaze and the Apache/nginx path is overhead in my situation. Running the app on webrick with stunnel for SSL doesn't provide certificate information to the app, so that is no-go for me.

Thanks,
Davor

Yorick Peterse

unread,
Mar 20, 2012, 2:07:21 PM3/20/12
to ram...@googlegroups.com
Davor,

Don't use WEBrick in production. I repeat, don't use it in production.
In short: it's probably the worst performing webserver you'll ever find.
If you want to keep things simple I recommend using Thin (gem install
thin) which has support for SSL. SSL can be used by running the
following command:

$ thin start --ssl --ssl-key-file=PRIVATE_KEY \
--ssl-cert-file=CERTIFICATE --ssl-verify

Yorick

> --
> You received this message because you are subscribed to the Google
> Groups "Ramaze" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/ramaze/-/n0iKxkWkhpMJ.
> To post to this group, send email to ram...@googlegroups.com.
> To unsubscribe from this group, send email to
> ramaze+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ramaze?hl=en.

signature.asc

Davor Šerfez

unread,
Mar 20, 2012, 2:20:05 PM3/20/12
to ram...@googlegroups.com
Thank you very much for the advice about 'webrick' and the 'thin' tip, I'll give it a try.

Regards,
Davor.

2012/3/20 Yorick Peterse <yorick...@gmail.com>
Reply all
Reply to author
Forward
0 new messages