httpi-adapter-openssl_gost 0.0.1 → 0.0.2

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: 7246e71d3ac930e54148951c0f832c4e285fb70b
4
- data.tar.gz: 0e1b4be04689555e7eeba4664beb366877713fe7
3
+ metadata.gz: 7ce75bfeccc88a1035be5077c09baded7bf6979c
4
+ data.tar.gz: 93b21175c1924df78e7be94504a0e458330d2690
5
5
  SHA512:
6
- metadata.gz: 7fd06b785759998e6ec5893f7c2d5292e452f3c9416241c66cbed363861db8da28ab61acd0ff57f122c691f01c844ffc7a713921a9ce8acacefc79f119175349
7
- data.tar.gz: e1c2581189f1bb79158f416c565b2b74ea4a678484c30c0092fcdcc665aec3e86d80a50a2c986e0e05cc317a62c896a6562ac22fdf30c77b946f46d891075e63
6
+ metadata.gz: 55c9e08aa87f67e54ba858bb0482b0238a8662a660f83dd0f0080a5158583135bc75910ecb5c4774508dea8a52d2eb95514d9e3ce6cd1c6b7e769f01904c5031
7
+ data.tar.gz: 19ec0fcee9cb4379600585d179d13cd82e397176f2945601b1410c454a1b354b4409cf5a1a1cc9c499d52abe6a49c05a39ce6944be40bac2de96f22d140bbbf8
data/README.md CHANGED
@@ -77,6 +77,8 @@ request.auth.ssl.cert_file = '/full/path/to/client.crt'
77
77
  request.auth.ssl.cert_key_file = '/full/path/to/client.pem'
78
78
  ```
79
79
 
80
+ Similarly, you can pass certificate authority certificate filepath to `ca_cert_file=` method. `openssl s_client` doesn't recognize system CA certificates automatically, this is a [known bug](https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/396818) (please hit «This bug affects me» link there).
81
+
80
82
  ### Usage with savon
81
83
 
82
84
  You need to use custom branches of [savon] and [wasabi] until next pull requests are not merged in:
@@ -95,10 +97,11 @@ Specify `:adapter` in savon client global options:
95
97
  ```ruby
96
98
  require 'httpi/adapter/openssl_gost'
97
99
  soap_client = Savon.client(
98
- wsdl: 'https://service-requiring-gost.ru/service?wsdl',
99
- ssl_cert_file: '/full/path/to/client.crt',
100
- ssl_cert_key_file: '/full/path/to/client.pem',
101
- adapter: :openssl_gost,
100
+ wsdl: 'https://service-requiring-gost.ru/service?wsdl',
101
+ ssl_cert_file: '/full/path/to/client.crt',
102
+ ssl_cert_key_file: '/full/path/to/client.pem',
103
+ ssl_ca_cert_key_file: '/full/path/to/ca.crt',
104
+ adapter: :openssl_gost,
102
105
  )
103
106
  ```
104
107
 
@@ -12,17 +12,20 @@ module HTTPI
12
12
  @request = request
13
13
  @pubkey_path = request.auth.ssl.cert_file
14
14
  @privkey_path = request.auth.ssl.cert_key_file
15
+ @cacert_path = request.auth.ssl.ca_cert_file
15
16
  end
16
17
 
17
18
  attr_reader :client
18
19
  attr_accessor :pubkey_path
19
20
  attr_accessor :privkey_path
21
+ attr_accessor :cacert_path
20
22
 
21
23
  def request(method)
22
24
  uri = @request.url
23
25
  cmd = "openssl s_client -engine gost -connect '#{uri.host}:#{uri.port}' -quiet"
24
- cmd += " -cert '#{pubkey_path}'" if pubkey_path
25
- cmd += " -key '#{privkey_path}'" if privkey_path
26
+ cmd += " -cert '#{pubkey_path}'" if pubkey_path
27
+ cmd += " -key '#{privkey_path}'" if privkey_path
28
+ cmd += " -CAfile '#{cacert_path}'" if cacert_path
26
29
 
27
30
  # Prepare request
28
31
  req = "#{method.upcase} #{uri.request_uri} HTTP/1.1\r\n"
@@ -3,7 +3,7 @@ require 'httpi'
3
3
  module HTTPI
4
4
  module Adapter
5
5
  class OpensslGost < Base
6
- VERSION = '0.0.1'
6
+ VERSION = '0.0.2'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpi-adapter-openssl_gost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-27 00:00:00.000000000 Z
11
+ date: 2014-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpi