OpenSSL :: SSL :: SSL错误:SSL_connect返回= 1 errno = 0状态= SSLv2 / v3读取服务器你好

时间:2019-03-27 00:18:42

标签: ruby chef

我正在尝试从Artifactory中的仓库中提取HTTPS二进制文件。

/var/chef/cookbooks/app/providers/setup.rb:48:in `determineRepoURL'
/var/chef/cookbooks/app/providers/setup.rb:86:in `deploy_compile_time_config_application'
/var/chef/cookbooks/app/providers/setup.rb:24:in `block (2 levels) in class_from_file'
/var/chef/cookbooks/app/providers/setup.rb:20:in `block in class_from_file'
...

[2019-03-26T17:11:39-07:00] ERROR: Running exception handlers
[2019-03-26T17:11:39-07:00] ERROR: Exception handlers complete
[2019-03-26T17:11:39-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 5 resources updated
[2019-03-26T17:11:39-07:00] ERROR: app_setup[test] (app::default line 40) had an error: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: tlsv1 alert protocol version

以前我有

def determineRepoURL(*param)
        url = "#{repository_url}/api/search/pattern?pattern=#{param[0]}:#{name}/#{version}/*#{param[1]}"
        uri = URI(url)
        http = Net::HTTP.new(uri.host, uri.port)
        request = Net::HTTP::Get.new(uri.request_uri)
        request.basic_auth "#{user}", "#{token}"
        response = http.request request # Net::HTTPResponse object
        result = JSON.parse(response.body)
        list = result['files'].sort.reverse
        return list[0]
end

添加后

        http.use_ssl = true
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE

我仍然有相同的错误。但是,由于某些原因,这仅在Chef's 11.8.2上发生,我在Chef's 12.6.0上尝试了我的脚本,但是我没有遇到此SSL证书问题,有人可以绕过11.8.2,因为我无权访问12.6.0

Ruby版本:1.8.7

OpenSSL版本:OpenSSL 1.0.1e-fips 2013年2月11日

0 个答案:

没有答案