rbvmomi忽略无效的ssl证书

时间:2014-02-05 20:41:59

标签: ruby ssl vsphere

我正在使用rbvmomi(ruby vsphere sdk)启动vsphere连接。有人知道忽略未签名的SSL证书错误的标志吗?

1.9.2-p320 :003 > vim = RbVmomi::VIM.connect host: '10.13.37.1', user: 'boot', password: 'passwordhere:)'
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:678:in `connect'
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:678:in `block in connect'
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:678:in `connect'
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:632:in `start'
    from /Users/f/.rvm/gems/ruby-1.9.2-p320/gems/rbvmomi-1.8.1/lib/rbvmomi/trivial_soap.rb:56:in `restart_http'
    from /Users/f/.rvm/gems/ruby-1.9.2-p320/gems/rbvmomi-1.8.1/lib/rbvmomi/trivial_soap.rb:20:in `initialize'
    from /Users/f/.rvm/gems/ruby-1.9.2-p320/gems/rbvmomi-1.8.1/lib/rbvmomi/connection.rb:31:in `initialize'
    from /Users/f/.rvm/gems/ruby-1.9.2-p320/gems/rbvmomi-1.8.1/lib/rbvmomi/vim.rb:36:in `new'
    from /Users/f/.rvm/gems/ruby-1.9.2-p320/gems/rbvmomi-1.8.1/lib/rbvmomi/vim.rb:36:in `connect'
    from (irb):3
    from /Users/f/.rvm/rubies/ruby-1.9.2-p320/bin/irb:16:in `<main>'

2 个答案:

答案 0 :(得分:1)

我在文档中找到了答案。

http://rdoc.info/github/rlane/rbvmomi/master/RbVmomi/VIM

:insecure 'true' 

答案 1 :(得分:0)

当前documentation表示我们必须通过一个选项来忽略此错误。

insecure: true