canzea 0.1.112 → 0.1.113

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: c7bd8adbe7260e7ef1a8c5b97fec8f425e3381f8
4
- data.tar.gz: 23a0e82666e31cd2f4e88a68cb0b83d4b4a08ee0
3
+ metadata.gz: 7e9ca2c10d1d784bdbeec96f575c11ba4b7bb461
4
+ data.tar.gz: 6ca457e117a47cc0ab0db3e3fd95030cab36176a
5
5
  SHA512:
6
- metadata.gz: b690cac427662fd511b7939b6cc5e33294c9cf4eaa00302535de26effd96ae638573df74756761ebd71a0939bb9333baf1fd230565e3e061db1ae5efbc38e48f
7
- data.tar.gz: 9309b2ad7ed0361b740e696416637d6d91e10b03ce4c4029d01b9cefdb52f06fa98695643860c020253a9cf6775b7eb69b738893c6ccca25e1050ef9b1fbcf45
6
+ metadata.gz: b36312019452e3067a896dc4d7909f45bf4e683b9dc6e78651e710ed7a01170289bebe20f1278356a401b916373905637a153b3428c5197e11a642d6390f9a66
7
+ data.tar.gz: 7ad1e7e0e6d5f1724d505a3f135dd47cc1053e98dbc35b26a78d79f191f8ed40bcc9fc8a70e2a8938012ba824e449a7277c47461dc8f9218f745e3982e96db5e
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.112"
2
+ VERSION = "0.1.113"
3
3
  end
data/lib/registry.rb CHANGED
@@ -104,7 +104,7 @@ class Registry
104
104
  def getSecret (key)
105
105
 
106
106
  uri = URI.parse(ENV["VAULT_URL"] + "/v1/secret/#{key}")
107
- http = prepareHttp(uri)
107
+ http = prepareHttpForVault(uri)
108
108
 
109
109
  request = Net::HTTP::Get.new(uri.request_uri)
110
110
  request['X-Vault-Token'] = ENV["VAULT_TOKEN"]
@@ -120,7 +120,7 @@ class Registry
120
120
  def setSecret (key, value)
121
121
 
122
122
  uri = URI.parse(ENV["VAULT_URL"] + "/v1/secret/#{key}")
123
- http = prepareHttp(uri)
123
+ http = prepareHttpForVault(uri)
124
124
 
125
125
  request = Net::HTTP::Put.new(uri.request_uri)
126
126
  request['Content-Type'] = 'application/json'
@@ -153,4 +153,23 @@ class Registry
153
153
  return http
154
154
  end
155
155
 
156
+ def prepareHttpForVault (uri)
157
+ http = Net::HTTP.new(uri.host, uri.port)
158
+
159
+ if (Canzea::config[:consul_tls])
160
+ pemCert = File.read(Canzea::config[:vault_tls_cert_file])
161
+ pemKey = File.read(Canzea::config[:vault_tls_key_file])
162
+
163
+ http.use_ssl = true
164
+ http.ca_file = Canzea::config[:consul_tls_ca_file]
165
+ http.cert = OpenSSL::X509::Certificate.new(pemCert)
166
+ http.key = OpenSSL::PKey::RSA.new(pemKey)
167
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
168
+ # http.set_debug_output($stdout)
169
+ http.ssl_version = :SSLv23
170
+ end
171
+
172
+ return http
173
+ end
174
+
156
175
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canzea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.112
4
+ version: 0.1.113
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies