Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting SSL error when requesting URLs starting with https:// #23

Closed
jcraigk opened this issue Nov 14, 2013 · 2 comments
Closed

Getting SSL error when requesting URLs starting with https:// #23

jcraigk opened this issue Nov 14, 2013 · 2 comments

Comments

@jcraigk
Copy link

jcraigk commented Nov 14, 2013

I'm not sure what changed from last week when this was working, but when I try to get the size of an image hosted at an HTTPS location using

FastImage.size([some SSL URL])

I get the following error:

SSL_connect returned=1 errno=0 state=unknown state: unknown protocol

As a workaround, I'm replacing "https" with "http" in the URLs before passing them to size() but it would be great if I could get this solved so it works with SSL URLs again.

It seems that the config in https://github.com/sdsykes/fastimage/blob/5a0399a8f5c8d8ef8d8a5b27d0ce071cfed5af9b/lib/fastimage.rb (line 259) should prevent this error, so I'm a bit confused.

Many thanks!

@sdsykes
Copy link
Owner

sdsykes commented Nov 14, 2013

Aha...

irb(main):001:0> require 'URI'
=> true
irb(main):002:0> a = URI.parse "https://www.google.com/images/srpr/logo11w.png"
=> #<URI::HTTPS:0x007fe7638c4978 URL:https://www.google.com/images/srpr/logo11w.png>
irb(main):003:0> a.port
=> 443
irb(main):004:0> require 'Addressable/uri'
=> true
irb(main):005:0> b = Addressable::URI.parse "https://www.google.com/images/srpr/logo11w.png"
=> #<Addressable::URI:0x3ff3b183798c URI:https://www.google.com/images/srpr/logo11w.png>
irb(main):006:0> b.port
=> nil

So addressable is not behaving in the same way URI does. Patch on its way.

@sdsykes
Copy link
Owner

sdsykes commented Nov 14, 2013

See also sporkmonger/addressable#29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants