How do I get Ruby On Rails Webrick to work with self-signed SSL certificate on localhost just to test https ? Basically, Ived followed the work that has been done here: Configure WEBrick to use automatically generated self-signed SSL/HTTPS certificate
And produce the script like the following:
require 'webrick'
require 'webrick/https'
cert_name = [
%w[CN localhost],
]
server = WEBrick::HTTPServer.new(:Port => 8000,
:SSLEnable => true,
:SSLCertName => cert_name)
# Shutdown gracefully on signal interrupt CTRL-C
# http://www.ruby-doc.org/core-2.1.1/Kernel.html#method-i-trap
trap('INT') { server.shutdown }
server.start
When I tried to access https://localhost:8000/, it did warn about trust but just went ahead, instead I had nothing come out but this. BTW, https works fine, just it seems its not getting the right route for SSL.
Not Found
`/' not found.
WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08) OpenSSL/1.0.2 at localhost:8000
console prints this:
[2015-07-25 23:38:25] INFO WEBrick::HTTPServer#start: pid=6765 port=8000
[2015-07-25 23:38:32] ERROR `/' not found.
localhost - - [25/Jul/2015:23:38:32 MYT] "GET / HTTP/1.1" 404 284
- -> /