From 39697391452a1306e4aef3a5126bd2b9639b5936 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 30 Jun 2016 17:10:26 +0200 Subject: use proper ssl connection with ca_file - green! --- lib/nickserver/adapters/celluloid_http.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/nickserver') 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 -- cgit v1.2.3