Skip to content

Instantly share code, notes, and snippets.

ISSUE:
Ran into this errors when adding Aumniauth with provider strategies such as Google to my rails app on Mac OS X development box. Clicking on 'Sign in with ...' (E.g. Sign in with Google), resulted in an error page:
Faraday::Error::ConnectionFailed
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Faraday::Error::ConnectionFailed SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
DIAGNOSIS:
@corsonx
corsonx / upload_via_iframe
Created January 10, 2014 14:48
Posting a form via AJAX through a hidden iFrame. This is necessary when uploading an image using ajax for IE < 10. It is also useful in other cases, where your post endpoint cannot easily digest JSON, for instance.
// This particular code works with html that looks like this:
<div class="upload_container" id="photo_number_1">
<div><input name="upload" class="photo_upload_field" type="file" /></div>
<div><input type="button" class="upload_photo_submit" value="Upload Photo"></div>
<p class="center loading hidden"><img src="/assets/loading.gif"></p>
<script>
// yes, I know, don't actually put this in a script tag here. It's for illustration purposes only
$('.upload_photo_submit')[0]).click(function(event){ajaxFileUpload(event);});
</script>