diff options
author | Azul <azul@riseup.net> | 2016-06-30 17:10:26 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-06-30 17:10:26 +0200 |
commit | 39697391452a1306e4aef3a5126bd2b9639b5936 (patch) | |
tree | 9e8516f9eb2e09bb7203011fdcd51f75e9ac281d /lib/nickserver | |
parent | fe9a23419f9a875a98fc05dc22e2ad6c5f6dbe3b (diff) |
use proper ssl connection with ca_file - green!
Diffstat (limited to 'lib/nickserver')
-rw-r--r-- | lib/nickserver/adapters/celluloid_http.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/nickserver/adapters/celluloid_http.rb b/lib/nickserver/adapters/celluloid_http.rb index 5ded702..9e5fa3b 100644 --- a/lib/nickserver/adapters/celluloid_http.rb +++ b/lib/nickserver/adapters/celluloid_http.rb @@ -9,9 +9,15 @@ module Nickserver::Adapters def get(url, options = {}) response = HTTP.get url, params: options[:query], + ssl_context: ctx, ssl_socket_class: Celluloid::IO::SSLSocket yield response.code, response.to_s end + def ctx + OpenSSL::SSL::SSLContext.new.tap do |ctx| + ctx.ca_file = Nickserver::Config.hkp_ca_file + end + end end end |