openssl在哪里搜索默认证书?

时间:2014-03-11 16:36:40

标签: ruby windows ssl openssl net-http

今天我在httpsruby windows处理C:\Users\Yuri\_>type 2.rb require 'net/http' Net::HTTP.get URI 'https://google.com' C:\Users\Yuri\_>2.rb c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:918:in `connect' from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:862:in `do_start' from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:851:in `start' from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:582:in `start' from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:477:in `get_response' from c:/Users/Yuri/programs/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:454:in `get' from C:/Users/Yuri/_/2.rb:2:in `<main>' 请求时遇到问题:

windows

所以我开始调查。据我现在所知,这是因为ruby sslprocmon版没有与C:\Users\Luis\Code\openknapsack\knap-build\var\knapsack\software\x86-windows\openssl\1.0.0k\ssl\cert.pem C:\Users\Luis\Code\openknapsack\knap-build\var\knapsack\software\x86-windows\openssl\1.0.0k\ssl\certs\ 证书捆绑在一起。我决定找出它们的位置。 libeay32.dll表示该脚本会尝试打开以下位置:

c:\Users\Yuri\programs\ruby-2.0.0-p353\bin>strings libeay32.dll | grep openknapsack
OPENSSLDIR: "C:/Users/Luis/Code/openknapsack/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0k/ssl"
C:/Users/Luis/Code/openknapsack/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0k/lib/engines
C:/Users/Luis/Code/openknapsack/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0k/ssl/private
C:/Users/Luis/Code/openknapsack/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0k/ssl
C:/Users/Luis/Code/openknapsack/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0k/ssl/certs
C:/Users/Luis/Code/openknapsack/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0k/ssl/cert.pem

事实证明这条路径在c

ruby

所以我想知道是否有更合理的方式来获取这些信息,比如使用小libeay32.dll程序,或者可能来自{{1}}?据说,这是由{{1}}构建的选项决定的。也许,人们可以通过检查the source来确定它,如果这是一个很好的链接。但这对我来说太难了。

0 个答案:

没有答案