6

Rails server throws a SSL error everytime I try to connect to the server.

[34087] Puma starting in cluster mode...
[34087] * Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller
[34087] * Min threads: 10, max threads: 10
[34087] * Environment: development
[34087] * Process workers: 1
[34087] * Phased restart available
[34087] * Listening on tcp://0.0.0.0:3001
[34087] * Listening on ssl://0.0.0.0:3000?cert=config/ssl.crt&key=config/ssl.key&verify_mode=none&no_tlsv1=false&no_tlsv1_1=false
[34087] Use Ctrl-C to stop
[34087] * Starting control server on unix:///tmp/puma-status-1596893456509-34087
[34087] - Worker 0 (pid: 34120) booted, phase: 0
2020-08-08 19:03:16 +0530: SSL error, peer: 127.0.0.1, peer cert: , #<Puma::MiniSSL::SSLError: OpenSSL error: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol - 337678594>

The ssl certificate and key are already provided from config in rails server but even then I keep getting ssl error

MAK
  • 123
  • 1
  • 9

1 Answers1

-1

Just had to setup my app to run with SSL in local development environment. Steps I took:

  1. Create certificates in the root of Your project folder:

$ openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt

  1. Start rails server like:

$ rails s -b 'ssl://localhost:3000?key=localhost.key&cert=localhost.crt'

Source

Maybe this can help You. In Your case You could probably omit first step and simply edit rails s command from step 2 with correct paths to Your localhost.key, localhost.crt files.

Can also mention that in my config/environemnts/development.rb I have added to the end of the file: config.force_ssl = true

Not sure if it`s necessary though.

Oskars Ezerins
  • 376
  • 3
  • 11