kontoapi-ruby 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kontoapi-ruby}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jan Schwenzien"]
12
- s.date = %q{2011-04-18}
12
+ s.date = %q{2011-04-20}
13
13
  s.description = %q{A ruby library to access the Konto API (https://www.kontoapi.de/), a webservice that performs validity checks and other services regarding german bank accounts.}
14
14
  s.email = %q{jan@general-scripting.com}
15
15
  s.extra_rdoc_files = [
data/lib/kontoapi-ruby.rb CHANGED
@@ -7,6 +7,7 @@ module KontoAPI
7
7
 
8
8
  extend self
9
9
 
10
+ RootCA = '/etc/ssl/certs'
10
11
  VALIDITY_URL = Addressable::URI.parse 'https://ask.kontoapi.de/for/validity.json'
11
12
  BANKNAME_URL = Addressable::URI.parse 'https://ask.kontoapi.de/for/bankname.json'
12
13
  DEFAULT_TIMEOUT = 10
@@ -56,8 +57,13 @@ module KontoAPI
56
57
  http = Net::HTTP.new(url.host, 443)
57
58
  http.use_ssl = true
58
59
  http.read_timeout = timeout
59
- # TODO include certs and enable SSL verification
60
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
60
+ if File.directory? RootCA
61
+ http.ca_path = RootCA
62
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
63
+ http.verify_depth = 5
64
+ else
65
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
66
+ end
61
67
  response = http.get url.request_uri, 'User-agent' => 'Konto API Ruby Client'
62
68
  case response
63
69
  when Net::HTTPSuccess, Net::HTTPOK
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontoapi-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jan Schwenzien
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-18 00:00:00 Z
18
+ date: 2011-04-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: addressable