1

我目前正在开发一个 Rails 应用程序,我想将 Openstack 与 OVH 的对象存储一起使用。

我的错误是:

connect_nonblock': SSL_connect returned=1 errno=0 state=unknown state:
certificate verify failed (OpenSSL::SSL::SSLError)
Unable to verify certificate. This may be an issue with the remote host or with Excon.Excon has certificates bundled, but these can be customized.

`Excon.defaults[:ssl_ca_path] = path_to_certs`,
`ENV['SSL_CERT_DIR'] = path_to_certs`,
`Excon.defaults[:ssl_ca_file] = path_to_file`,
`ENV['SSL_CERT_FILE'] = path_to_file`,
`Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback),
or `Excon.defaults[:ssl_verify_peer] = false` (less secure). (Excon::Errors::CertificateError)

有人有提示吗?

我已经用法语学习了本教程: https ://gist.github.com/BaptisteDixneuf/85dc4419a0398446d2d3

还有我的carrierwave配置文件:

CarrierWave.configure do |config|
 config.fog_provider = 'fog/openstack'
 config.fog_credentials = {
    :provider              => 'OpenStack',
    :openstack_username    => ENV['OS_USERNAME'],
    :openstack_api_key => ENV['OS_USER_MDP'],
    :openstack_auth_url => ENV['OS_AUTH_URL'],
    :openstack_region    => 'GRA1'
  }

end
4

1 回答 1

1

正如它所说,您的应用程序无法连接到 openstack,因为它无法检查证书。

然后它提供了各种方法来克服这个问题。

这些用于手动提供证书

`Excon.defaults[:ssl_ca_path] = path_to_certs`,
`ENV['SSL_CERT_DIR'] = path_to_certs`,
`Excon.defaults[:ssl_ca_file] = path_to_file`,
`ENV['SSL_CERT_FILE'] = path_to_file`,

另外两个绕过标准验证,分别手动检查并忽略它。

`Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback),
or `Excon.defaults[:ssl_verify_peer] = false` (less secure). (Excon::Errors::CertificateError)

OVH 的 Openstack 云使用了有效的证书。确保您的服务器安装了通用 ca-certificat 列表。并更新 openssl 库。

于 2016-06-24T08:38:10.433 回答