title: asset_sync/fog Unable to verify SSL certificate
body: <p>I want to use the <a href="https://github.com/rumblelabs/asset_sync" rel="nofollow noreferrer">asset_sync</a> gem to compile my Rails-assets locally and then upload them to my S3 bucket.
  But when I try to compile &amp; upload them the rake task aborts because it's unable to verify the SSL-certificate.</p>
  
  <p>I'm struggling around for 3 days to find a workaround for this problem but nothing solved it.</p>
  
  <p>Found out that the OpenSSL of rubyinstaller.org's builds is <a href="https://groups.google.com/d/msg/rubyinstaller/DVIDvs7xKC0/8dqXCqmABk0J" rel="nofollow noreferrer">broken</a>, but  even if I set <code>SSL_CERT_FILE</code> <a href="https://gist.github.com/pweldon/767249" rel="nofollow noreferrer">manually</a> the rake task fails with the same error (Even though I can make a HTTPS-connection in ruby with that setting).</p>
  
  <p><strong>Works:</strong></p>
  
  <pre><code>set SSL_CERT_FILE=C:\ruby\cacert_test\cacert.pem
  ruby -ropen-uri -e 'puts open("https://www.google.com/accounts").read'
  </code></pre>
  
  <p><strong>Fails:</strong></p>
  
  <pre><code>set SSL_CERT_FILE=C:\ruby\cacert_test\cacert.pem
  bundle exec rake assets:precompile RAILS_ENV=production
  </code></pre>
  
  <p><em>System: Win 8.1 (x64) and ruby 2.1 (x64) (from <a href="http://rubyinstaller.org/" rel="nofollow noreferrer">rubyinstaller</a>)</em></p>
  
  <p>Error-log:</p>
  
  <pre><code>Excon::Errors::SocketError: Unable to verify certificate, please set `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).
  OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
  ...
  </code></pre>
  
  <p>Related:  </p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/25701632/unable-to-verify-certificate-please-set-envssl-cert-file-path-to-file">Unable to verify certificate - please set &#39;ENV[&#39;SSL_CERT_FILE&#39;] = path_to_file&#39;</a>,</p></li>
  <li><p><a href="https://stackoverflow.com/questions/5720484/how-to-solve-certificate-verify-failed-on-windows">How to solve &quot;certificate verify failed&quot; on Windows?</a></p></li>
  </ul>