piedesaint 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7969c9a6b8f252cae38aa29a696de6778ddfca03
4
- data.tar.gz: 95307f09524bef075344a7aeb233a57a8103d704
3
+ metadata.gz: 9a67bed518cb262ac669a97ad0283f805e2b12bc
4
+ data.tar.gz: d0d02fbacbd4ee1bf4f8065d3231136e8571c848
5
5
  SHA512:
6
- metadata.gz: fb34f96ffaa2c258e9358c5454af46a7618fe1c6e6c9200c79da19029ee48c8b8840d701039c1f9057b72d6035e2f2b12b6f8e9ca1ad126570d9cac6c57cfebd
7
- data.tar.gz: 9395f2195125f870431fc2dbbddf0aa1f6c5415bbbe16aee1b2466b310234e013317fbe3ee561731db747f486a7a0c623a992e9be969a7f2d00d3a80c12abb75
6
+ metadata.gz: 4d7f48a002c02e4ccd3a703890a576482e69ad1d1513a42a3e40df1c93b2fae3ea999df7bf5cb934a1be5fbf576ec2c6ea9119a53ff3b12ac9184a8c8f153c3a
7
+ data.tar.gz: 67f31bf0a390ed4e4213ca9a720d8dd0214618b195a6a45529a4bc7fa8473fc7497c6cb0cdf95e7face5523e8dd17426f8813aec8ceda6033cf0cfed9ce084d6
data/lib/piedesaint.rb CHANGED
@@ -75,7 +75,9 @@ module Piedesaint
75
75
  ::Rack::Builder.app do
76
76
  use ::Rack::CommonLogger
77
77
  use ::Rack::ShowExceptions
78
- use ::Rack::SslEnforcer, http_port: options[:http_port], https_port: options[:https_port]
78
+ if ( !options[:key].nil? and !options[:key].empty? )
79
+ use ::Rack::SslEnforcer, http_port: options[:http_port], https_port: options[:https_port]
80
+ end
79
81
  use ::Rack::Deflater
80
82
 
81
83
  if options[:username].nil? or options[:username].empty?
@@ -118,13 +120,15 @@ module Piedesaint
118
120
  #ctx.cert = "./server.crt"
119
121
  #ctx.verify_mode = ::Puma::MiniSSL::VERIFY_NONE
120
122
 
121
- ctx = ::OpenSSL::SSL::SSLContext.new
122
- ctx.key = OpenSSL::PKey::RSA.new File.read(options[:key])
123
- ctx.cert = OpenSSL::X509::Certificate.new File.read(options[:cert])
124
- ctx.verify_mode = ::OpenSSL::SSL::VERIFY_NONE
125
-
126
123
  puma.add_tcp_listener options[:host], options[:http_port]
127
- puma.add_ssl_listener options[:host], options[:https_port], ctx
124
+
125
+ if ( !options[:key].nil? and !options[:key].empty? )
126
+ ctx = ::OpenSSL::SSL::SSLContext.new
127
+ ctx.key = OpenSSL::PKey::RSA.new File.read(options[:key])
128
+ ctx.cert = OpenSSL::X509::Certificate.new File.read(options[:cert])
129
+ ctx.verify_mode = ::OpenSSL::SSL::VERIFY_NONE
130
+ puma.add_ssl_listener options[:host], options[:https_port], ctx
131
+ end
128
132
 
129
133
  puma.min_threads = 1
130
134
  puma.max_threads = 10
@@ -1,3 +1,3 @@
1
1
  module Piedesaint
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piedesaint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tnarik Innael