Skip to content

Commit 09b9743

Browse files
author
Nathan Sutton
committed
Setup a cert store for https connections so we can set the default paths
1 parent 925b58d commit 09b9743

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/zencoder/http/net_http.rb

+10-3
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,17 @@ def http
6262
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
6363
else
6464
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
65-
end
6665

67-
http.ca_file = ca_file if ca_file
68-
http.ca_path = ca_path if ca_path
66+
http.cert_store = OpenSSL::X509::Store.new
67+
http.cert_store.set_default_paths
68+
69+
if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
70+
http.cert_store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
71+
end
72+
73+
http.cert_store.add_file(ca_file) if ca_file
74+
http.cert_store.add_path(ca_path) if ca_path
75+
end
6976
end
7077

7178
http

0 commit comments

Comments
 (0)