{"id":15512044,"url":"https://github.com/codica2/rails-puma-ssl","last_synced_at":"2026-03-14T05:02:33.875Z","repository":{"id":98303427,"uuid":"181864787","full_name":"codica2/rails-puma-ssl","owner":"codica2","description":":closed_lock_with_key: Easy way to start using SSL in development","archived":false,"fork":false,"pushed_at":"2019-04-17T10:32:30.000Z","size":1325,"stargazers_count":40,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T13:10:08.544Z","etag":null,"topics":["puma","rails","ssl-certificate","ssl-support"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codica2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-17T09:59:27.000Z","updated_at":"2023-06-25T17:06:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee80b957-b3f6-4c83-ac32-42dafcffac49","html_url":"https://github.com/codica2/rails-puma-ssl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codica2/rails-puma-ssl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Frails-puma-ssl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Frails-puma-ssl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Frails-puma-ssl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Frails-puma-ssl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codica2","download_url":"https://codeload.github.com/codica2/rails-puma-ssl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Frails-puma-ssl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261505284,"owners_count":23169001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["puma","rails","ssl-certificate","ssl-support"],"created_at":"2024-10-02T09:53:23.581Z","updated_at":"2026-03-14T05:02:33.769Z","avatar_url":"https://github.com/codica2.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# How to use self-signed SSL certificate for local development on Rails\n\n\u003cp align='center'\u003e\n  \u003cimg src='images/header.jpg'\u003e\n\u003c/p\u003e\n\nSSL (Secure Sockets Layer) is the standard security technology for establishing an encrypted link between a web server and a browser.\n\n## In short\n\n```bash\n$\u003e openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt\n$\u003e rails s -b 'ssl://localhost:3000?key=localhost.key\u0026cert=localhost.crt'\n```\n\n## Why you may need SSL in development?\n\nCheck this [tweet](https://twitter.com/getify/status/1023202051902373888) to find the answer.\n\nShort summary:\n\n- No mixed-content warnings\n- Using features / third-party integrations that require SSL\n- URL logic (routing, history, redirects)\n\n## Let's rock\n\nFirstly, start the server and make sure that the HTTPS connection is not established.\n\n```bash\n$\u003e rails s\n\n=\u003e Booting Puma\n=\u003e Rails 5.2.3 application starting in development\n=\u003e Run `rails server -h` for more startup options\nPuma starting in single mode...\n* Version 3.12.1 (ruby 2.5.1-p57), codename: Llamas in Pajamas\n* Min threads: 5, max threads: 5\n* Environment: development\n* Listening on tcp://localhost:3000\nUse Ctrl-C to stop\n```\n\nBrowser:\n\n\u003cp align='center'\u003e\n  \u003cimg src='images/https-fail.png'\u003e\n\u003c/p\u003e\n\nPuma logs:\n\n```bash\n---\nx: HTTP parse error, malformed request (): #\u003cPuma::HttpParserError: Invalid HTTP format, parsing fails.\u003e\n---\n```\n\n## Step one: generate the cert\n\n```bash\n$\u003e openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt\n```\n\n\u003e NOTE: you can change days parameter (365) for any number to affect the expiration date.\n\nYou will be provided with some information fields to fill in about country key, email, etc. However, you can skip this step. This command will create two new files `localhost.key` and `localhost.crt` in the current directory. You can move these files anywhere.\n\n## Step two: run a server with the certificate\n\n```bash\n$\u003e rails s -b 'ssl://localhost:3000?key=localhost.key\u0026cert=localhost.crt'\n\n=\u003e Booting Puma\n=\u003e Rails 5.2.3 application starting in development\n=\u003e Run `rails server -h` for more startup options\nPuma starting in single mode...\n* Version 3.12.1 (ruby 2.5.1-p57), codename: Llamas in Pajamas\n* Min threads: 5, max threads: 5\n* Environment: development\n* Listening on ssl://localhost:3000?key=localhost.key\u0026cert=localhost.crt\nUse Ctrl-C to stop\n```\n\nBrowser:\n\n\u003cp align='center'\u003e\n  \u003cimg src='images/https-success.png'\u003e\n\u003c/p\u003e\n\n\u003e NOTE: Firstly, click 'ADVANCED' (i) and then 'Proceed to localhost (unsafe)' (ii).\n\n\u003cp align='center'\u003e\n  \u003cimg src='images/it-works.png'\u003e\n\u003c/p\u003e\n\nPuma logs:\n\n```bash\n...\n\nStarted GET \"/\" for ::1 at 2019-04-16 16:02:11 +0300\nProcessing by Rails::WelcomeController#index as HTML\n  Rendering rails/templates/rails/welcome/index.html.erb\n  Rendered rails/templates/rails/welcome/index.html.erb (2.6ms)\nCompleted 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.0ms)\n\n...\n```\n\n## License\n\nCopyright © 2015-2019 Codica. It is released under the [MIT License](https://opensource.org/licenses/MIT).\n\n## About Codica\n\n[![Codica logo](https://www.codica.com/assets/images/logo/logo.svg)](https://www.codica.com)\n\nWe love open source software! See [our other projects](https://github.com/codica2) or [hire us](https://www.codica.com/) to design, develop, and grow your product.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodica2%2Frails-puma-ssl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodica2%2Frails-puma-ssl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodica2%2Frails-puma-ssl/lists"}