busser 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,10 @@
1
+ ## 0.4.1 / 2013-04-23
2
+
3
+ ### Improvements
4
+
5
+ * Add method to Drop SSL verify peer to VERIFY_NONE within a given block (see commit for explanation). ([@fnichol][])
6
+
7
+
1
8
  ## 0.4.0 / 2013-04-10
2
9
 
3
10
  ### New features
@@ -16,6 +16,8 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
+ require 'openssl'
20
+
19
21
  require 'busser/rubygems'
20
22
  require 'busser/thor'
21
23
 
@@ -75,7 +77,7 @@ module Busser
75
77
  klass = Busser::Plugin.runner_class(::Thor::Util.camel_case(name))
76
78
  if klass.respond_to?(:run_postinstall)
77
79
  banner "Running postinstall for #{name} plugin"
78
- klass.run_postinstall
80
+ drop_ssl_verify_peer { klass.run_postinstall }
79
81
  end
80
82
  end
81
83
 
@@ -83,6 +85,22 @@ module Busser
83
85
  spec = Busser::Plugin.gem_from_path(Busser::Plugin.runner_plugin(name))
84
86
  spec && spec.name == "busser"
85
87
  end
88
+
89
+ # Drops SSL verify peer to VERIFY_NONE within a given block. While this
90
+ # is normally a massive anti-pattern and should be discouraged, there
91
+ # may be some Busser code that needs to be executed in an environment
92
+ # that lacks a proper SSL certificate store.
93
+ #
94
+ # Please use with extreme caution.
95
+ #
96
+ def drop_ssl_verify_peer
97
+ before = OpenSSL::SSL::VERIFY_PEER
98
+ OpenSSL::SSL.send(:remove_const, 'VERIFY_PEER')
99
+ OpenSSL::SSL.const_set('VERIFY_PEER', OpenSSL::SSL::VERIFY_NONE)
100
+ yield
101
+ OpenSSL::SSL.send(:remove_const, 'VERIFY_PEER')
102
+ OpenSSL::SSL.const_set('VERIFY_PEER', before)
103
+ end
86
104
  end
87
105
  end
88
106
  end
@@ -17,5 +17,5 @@
17
17
  # limitations under the License.
18
18
 
19
19
  module Busser
20
- VERSION = "0.4.0"
20
+ VERSION = "0.4.1"
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: busser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-10 00:00:00.000000000 Z
12
+ date: 2013-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -343,9 +343,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
343
343
  - - ! '>='
344
344
  - !ruby/object:Gem::Version
345
345
  version: '0'
346
- segments:
347
- - 0
348
- hash: -3072870193518328315
349
346
  requirements: []
350
347
  rubyforge_project:
351
348
  rubygems_version: 1.8.24