Amazon S3
,使用rails
和fog
。
尝试使用rake assets:precompile
预编译我的 Assets :
信息:
[WARNING] fog: followed redirect to myproject.de.s3-us-west-2.amazonaws.com, connecting to the matching region will be more performant
rake aborted!
hostname does not match the server certificate (OpenSSL::SSL::SSLError)
因此,OpenSSL有所作为
我已经尝试了什么:
application.rb
中配置证书:没有成功。AWS.config(:http_handler => AWS::Http::HTTPartyHandler.new(:ssl_ca_path =>“/ etc / ssl / certs”))
openssl
问题是:
Amazon S3如何处理证书
最佳答案
实际上,您可以使用带点的存储桶名称。您所要做的就是将:path_style => true
添加到config.fog_credentials
中。
在您的示例中,它将给出:
config.fog_credentials = {
:provider => 'AWS',
:aws_access_key_id => ENV['S3_KEY'],
:aws_secret_access_key => ENV['S3_SECRET'],
:region => ENV['S3_REGION'],
:path_style => true
}
config.fog_directory = "myproject.de"
关于ruby-on-rails - Amazon S3-主机名与服务器证书(OpenSSL::SSL::SSLError)+ rails 不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18340551/