Sha256: 1fe2f8a28d7392fa6af1a754880f4363f2c957af1f45eda2f2d8866b4eaffceb

Contents?: true

Size: 911 Bytes

Versions: 28

Compression:

Stored size: 911 Bytes

Contents

#!/usr/bin/env ruby
require 'webrick'
require 'webrick/https'
require 'openssl'

private_key_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "privateKey.key"))
cert_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "certificate.crt"))

pkey = OpenSSL::PKey::RSA.new(File.read(private_key_file))
cert = OpenSSL::X509::Certificate.new(File.read(cert_file))

pid_file = ARGV[0]

s = WEBrick::HTTPServer.new(
  :Port => 8443,
  :Logger => WEBrick::Log::new(nil, WEBrick::Log::ERROR),
  :DocumentRoot => File.join(File.dirname(__FILE__)),
  :ServerType => WEBrick::Daemon,
  :SSLEnable => true,
  :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
  :SSLCertificate => cert,
  :SSLPrivateKey => pkey,
  :SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ],
  :StartCallback => proc { File.open(pid_file, "w") { |f| f.write $$.to_s }}
)
trap("INT"){ s.shutdown }
s.start

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
braintree-1.2.1 spec/script/httpsd.rb
braintree-1.2.0 spec/script/httpsd.rb
braintree-1.1.3 spec/script/httpsd.rb
braintree-1.1.2 spec/script/httpsd.rb
braintree-1.1.1 spec/script/httpsd.rb
braintree-1.1.0 spec/script/httpsd.rb
braintree-1.0.1 spec/script/httpsd.rb
braintree-1.0.0 spec/script/httpsd.rb