Skip to content

Instantly share code, notes, and snippets.

@sbtk44
Created December 12, 2016 06:19
Show Gist options
  • Select an option

  • Save sbtk44/347ec00ad8e77afe7639df0ada8bc9ac to your computer and use it in GitHub Desktop.

Select an option

Save sbtk44/347ec00ad8e77afe7639df0ada8bc9ac to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'
require 'webrick/https'
require 'webrick/ssl'
module Rails
class Server < ::Rack::Server
def default_options
super.merge(
Port: 3000,
environment: (ENV['RAILS_ENV'] || "development").dup,
daemonize: false,
debugger: false,
pid: File.expand_path("tmp/pids/server.pid"),
config: File.expand_path("config.ru"),
SSLEnable: true,
SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE,
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.open("certs/localhost.key").read),
SSLCertificate: OpenSSL::X509::Certificate.new(File.open("certs/localhost.crt").read),
SSLCertName: [["CN", 'localhost']]
)
end
end
end
require 'rails/commands'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment