simbiotes 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f56f30c2db7193cbb471c192c8c70a128e5a64e
4
- data.tar.gz: 306aec5651911a1b2a3ec9570a389d0079aa911d
3
+ metadata.gz: ea86cc934275ad9bee68dff9df9394f5a3c206b8
4
+ data.tar.gz: 7a70964b49e63fe9c4f4d828967c36b0fa223719
5
5
  SHA512:
6
- metadata.gz: 8e2a92d1d3b173de9f26d09262b1d07075d11533435fe3cbde07c99f210e787f28d0a1f547490633ffa1f986231854960cd3a5eb788bc2a215feb46eb3b8b213
7
- data.tar.gz: 93422e1c25470b966ddf12c96a944fedf62e0b2a9ab4ce15ba0f29f0ce8bfcbfff12de56e1edb0b57cefff68831ee6e0fb0a4db93db3cd3e428f5c66f9427d65
6
+ metadata.gz: 961f8ba083b6d2fa0b78051ccb2c71c96dccf26b51c462bfd6ad2087d4603acd6b03adc883c6a875689ddf13b1b0d85f484ac76f82a6e5683948f30601db03d2
7
+ data.tar.gz: aa0c4a2f70947fd66b06a37e071a7084c508af9f9bdc04e163595a55904a768af4cd3fa6c96b8dad57b3fb0d41197588f171c9325c5a6734c7c7f05286ab6e84
@@ -4,5 +4,6 @@ Simbiotes.configure do |config|
4
4
  config.local_port = 8001
5
5
  config.server_port = 8000
6
6
  config.tls = true
7
+ config.verify_peer = true
7
8
  config.local_logging = true
8
9
  end
@@ -1,7 +1,7 @@
1
1
  module Simbiotes
2
2
  class Configuration
3
3
 
4
- attr_accessor :public_key, :private_key, :local_logging, :targets, :local_port, :server, :server_port, :portal, :push, :tls
4
+ attr_accessor :public_key, :private_key, :local_logging, :targets, :local_port, :server, :server_port, :portal, :push, :tls, :verify_peer
5
5
 
6
6
  def initialize
7
7
  @public_key = nil
@@ -14,6 +14,7 @@ module Simbiotes
14
14
  @portal = "http://www.simbiotes.com/"
15
15
  @push = false
16
16
  @tls = true
17
+ @verify_peer = true
17
18
  end
18
19
 
19
20
  end
@@ -146,5 +146,11 @@ module Simbiotes
146
146
  return instance_hash["certificate"]
147
147
  end
148
148
 
149
+ def self.ca_certificate
150
+ response = HTTParty.post("#{Simbiotes.configuration.portal}api/ca_certificate", :query => {:public_key => Simbiotes.configuration.public_key, :private_key => Simbiotes.configuration.private_key}).body
151
+ hash = JSON.parse(response)
152
+ return hash["ca_certificate"]
153
+ end
154
+
149
155
  end
150
156
  end
@@ -12,8 +12,10 @@ module Simbiotes
12
12
  context = OpenSSL::SSL::SSLContext.new
13
13
  context.key = Server.key
14
14
  context.cert = Server.cert
15
- context.ca_cert = Server.ca_cert
16
- context.verify_mode = OpenSSL::SSL::VERIFY_PEER
15
+ if Simbiotes.configuration.verify_peer == true
16
+ context.ca_file = Server.ca_cert
17
+ context.verify_mode = OpenSSL::SSL::VERIFY_PEER
18
+ end
17
19
  server = OpenSSL::SSL::SSLSocket.new socket, context
18
20
  server.sync_close = true
19
21
  server.connect
@@ -143,7 +145,7 @@ module Simbiotes
143
145
  def self.ca_cert
144
146
  ca_cert = SimbiotesSetting.find_by(key: "ca_cert")
145
147
  if ca_cert == nil
146
- ca_cert = Simbiotes::Portal.generate_certificate(csr)
148
+ ca_cert = Simbiotes::Portal.ca_certificate
147
149
  c = SimbiotesSetting.new
148
150
  c.key = "ca_cert"
149
151
  c.value = ca_cert
@@ -1,3 +1,3 @@
1
1
  module Simbiotes
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simbiotes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - MicroArx Corporation