Goal: get ssl working in development mode (ssl works fine in production on heroku)
My setup: Ubuntu 16.04 Rails 5.0.1 Puma 3.6.2
config/environments/development.rb
config.force_ssl = true
I tried following along with this puma ssl how-to: https://gist.github.com/tadast/9932075 (I am not sure what github procol is regarding pasting above link content here vs referencing it)
if I then use the command line method to run puma
puma -b 'ssl://127.0.0.1:3000?key=/home/sean/.ssh/server.key&cert=/home/sean/.ssh/server.crt'
I am getting Chrome's 'Not Secure' error when trying to access via the browser after attempting to add certificate to ubuntu.
sudo cp server.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Should I see 1 added here? I also tried copying server.crt to /etc/ssl/certs
If I proceed past chrome block I get console error:
SSL error, peer: 127.0.0.1, peer cert: , #<Puma::MiniSSL::SSLError: OpenSSL error: error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request - 336027804>
Instead of using puma on command line I tried adding to config/initializers/puma.rb
bind 'ssl://127.0.0.1:3000?key=/home/sean/.ssh/server.key&cert=/home/sean/.ssh/server.crt'
and starting: rails s
I do not get any page load but console shows:
HTTP parse error, malformed request (): # 2017-01-23 10:04:43 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"puma 3.6.2 Sleepy Sunday Serenity", "GATEWAY_INTERFACE"=>"CGI/1.2"}
I also tried downgrading puma to 3.5.2
Where am I going wrong?