Sha256: 02f2e1e3948f7e06343f9403cdfb0a7cec56b5b1deb96b5aa7a34e913d66d2f4

Contents?: true

Size: 937 Bytes

Versions: 76

Compression:

Stored size: 937 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 => (ENV['SSL_TEST_PORT'] || 8444),
  :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

76 entries across 76 versions & 1 rubygems

Version Path
braintree-2.54.0 spec/script/httpsd.rb
braintree-2.50.0 spec/script/httpsd.rb
braintree-2.49.0 spec/script/httpsd.rb
braintree-2.48.1 spec/script/httpsd.rb
braintree-2.48.0 spec/script/httpsd.rb
braintree-2.47.0 spec/script/httpsd.rb
braintree-2.46.0 spec/script/httpsd.rb
braintree-2.45.0 spec/script/httpsd.rb
braintree-2.44.0 spec/script/httpsd.rb
braintree-2.43.0 spec/script/httpsd.rb
braintree-2.42.0 spec/script/httpsd.rb
braintree-2.41.0 spec/script/httpsd.rb
braintree-2.40.0 spec/script/httpsd.rb
braintree-2.39.0 spec/script/httpsd.rb
braintree-2.38.0 spec/script/httpsd.rb
braintree-2.37.0 spec/script/httpsd.rb