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-2.10.3 spec/script/httpsd.rb
braintree-2.12.0 spec/script/httpsd.rb
braintree-2.11.0 spec/script/httpsd.rb
braintree-2.10.2 spec/script/httpsd.rb
braintree-2.10.1 spec/script/httpsd.rb
braintree-2.10.0 spec/script/httpsd.rb
braintree-2.9.1 spec/script/httpsd.rb
braintree-2.8.0 spec/script/httpsd.rb
braintree-2.7.0 spec/script/httpsd.rb
braintree-2.6.3 spec/script/httpsd.rb
braintree-2.6.2 spec/script/httpsd.rb
braintree-2.6.1 spec/script/httpsd.rb
braintree-2.6.0 spec/script/httpsd.rb
braintree-2.5.2 spec/script/httpsd.rb
braintree-2.5.1 spec/script/httpsd.rb
braintree-2.4.0 spec/script/httpsd.rb
braintree-2.3.1 spec/script/httpsd.rb
braintree-2.2.0 spec/script/httpsd.rb
braintree-2.1.0 spec/script/httpsd.rb
braintree-2.0.0 spec/script/httpsd.rb