Sha256: 32d9032cf06a1649cb1d7d6cdd05925b817d7ee36af41a56a372b98661d5c57e

Contents?: true

Size: 816 Bytes

Versions: 154

Compression:

Stored size: 816 Bytes

Contents

#!/usr/bin/env ruby

require 'webrick/https'
require 'getopts'

getopts nil, 'r:', 'p:8808'

dir = File::dirname(File::expand_path(__FILE__))

# Pass phrase of '1000key.pem' is '1000'.
data = open(File::join(dir, "1000key.pem")){|io| io.read }
pkey = OpenSSL::PKey::RSA.new(data)
data = open(File::join(dir, "1000cert.pem")){|io| io.read }
cert = OpenSSL::X509::Certificate.new(data)

s = WEBrick::HTTPServer.new(
  :BindAddress      => "localhost",
  :Port             => $OPT_p.to_i, 
  :Logger           => nil,
  :DocumentRoot     => $OPT_r || File::join(dir, "/htdocs"),
  :SSLEnable        => true,
  :SSLVerifyClient  => ::OpenSSL::SSL::VERIFY_NONE,
  :SSLCertificate   => cert,
  :SSLPrivateKey    => pkey,
  :SSLCertName      => nil,
  :SSLCACertificateFile => "all.pem"
)
trap("INT"){ s.shutdown }
s.start

Version data entries

154 entries across 146 versions & 13 rubygems

Version Path
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
httpclient-fixcerts-2.8.5 sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.9 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.6 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.5 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.4 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.3 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.2 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.1 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
video_chat_get-0.1.0 vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/sample/ssl/webrick_httpsd.rb