activecypher 0.6.1 → 0.6.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d9c41285d4f1a84779d72a479b329e6c397d4630473d369691456e35f4337fc
|
4
|
+
data.tar.gz: 1673192a6552da378dfd625114f8bc8eee8e973eb17583d802de8fcbcd609c70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6feecb3dbad832f8f8253f64b3ccb030d2fe99194824d57bf5087db7caee2e335a4e7a6b21646e7ba098250812f3b05d4a5c812b7d8b0cc5b8e93e23f1c56ebb
|
7
|
+
data.tar.gz: f389ab164a37e002523c55e050abc1bee7c20df6e5c6e11e311f2a5f6200a33d27ac4512f676f36eebd155ce2f71f21c87a08f9431f0fe641d1051f09aee21be
|
@@ -34,9 +34,22 @@ module ActiveCypher
|
|
34
34
|
{ scheme: 'none' }
|
35
35
|
end
|
36
36
|
|
37
|
+
# Get SSL connection params
|
38
|
+
ssl_params = if config[:url]
|
39
|
+
resolver = ActiveCypher::ConnectionUrlResolver.new(config[:url])
|
40
|
+
resolver.ssl_connection_params
|
41
|
+
else
|
42
|
+
{
|
43
|
+
secure: config[:ssl] ? true : false,
|
44
|
+
verify_cert: config[:ssc] ? false : true
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
37
48
|
@connection = Bolt::Connection.new(
|
38
49
|
host, port, self,
|
39
|
-
auth_token: auth,
|
50
|
+
auth_token: auth,
|
51
|
+
timeout_seconds: config.fetch(:timeout, 15),
|
52
|
+
**ssl_params
|
40
53
|
)
|
41
54
|
@connection.connect
|
42
55
|
validate_connection
|
@@ -81,13 +81,15 @@ module ActiveCypher
|
|
81
81
|
principal: config[:username],
|
82
82
|
credentials: config[:password]
|
83
83
|
}
|
84
|
+
# Get SSL connection params from resolver
|
85
|
+
ssl_params = resolver.ssl_connection_params
|
86
|
+
|
84
87
|
ActiveCypher::Bolt::Driver.new(
|
85
88
|
uri: uri,
|
86
89
|
adapter: adapter,
|
87
90
|
auth_token: auth_token,
|
88
91
|
pool_size: pool_size,
|
89
|
-
|
90
|
-
verify_cert: config[:ssc] ? false : true
|
92
|
+
**ssl_params
|
91
93
|
)
|
92
94
|
end
|
93
95
|
end
|
@@ -62,6 +62,17 @@ module ActiveCypher
|
|
62
62
|
}
|
63
63
|
end
|
64
64
|
|
65
|
+
# Returns SSL/TLS connection parameters based on ssl/ssc flags
|
66
|
+
# @return [Hash] Connection parameters for SSL/TLS
|
67
|
+
def ssl_connection_params
|
68
|
+
return {} unless @parsed
|
69
|
+
|
70
|
+
{
|
71
|
+
secure: @parsed[:ssl] ? true : false,
|
72
|
+
verify_cert: @parsed[:ssc] ? false : true
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
65
76
|
private
|
66
77
|
|
67
78
|
def parse_url(url_string)
|