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

Add support to fetch images over HTTPS #33

Closed
kleisauke opened this Issue Feb 12, 2017 · 5 comments

Comments

4 participants
@kleisauke
Member

kleisauke commented Feb 12, 2017

Add support to fetch images over HTTPS [2693328]

Submitted by Anonymous on 18-3-2012 0:00:00
0 votes on UserVoice prior to migration

Response

by Andries Louw Wolthuizen on 5-1-2013 0:00:00

Sorry for the late update on this question, but you can now use the prefix ssl:
Example:
http://images.weserv.nl/?url=ssl:www.google.com/logos/logo.gif
Will fetch https://www.google.com/logos/logo.gif
If you’re experiencing any issues, please report them!

Comments

Comment by Andries Louw Wolthuizen (Webmaster, Images.weserv.nl - Image cache & resize proxy) on 19-3-2012 10:32:00

Good idea! I'll need to investigate how much changes this requires in our code, this is because of the different caching- and connection-layers when retrieving images from their origin.
It is, however, something that has been on our wish-list as well, thanks for bringing it under attention again!

Comment by Andries Louw Wolthuizen (Webmaster, Images.weserv.nl - Image cache & resize proxy) on 26-6-2012 23:32:00

Sorry for the late update on this question, but you can now use the prefix ssl:
Example:
http://images.weserv.nl/?url=ssl:www.google.com/logos/logo.gif
Will fetch https://www.google.com/logos/logo.gif
If you're experiencing any issues, please report them!

Comment by Luuk Lamers on 1-2-2016 20:15:00

Hi there, I've run into a problem where using SSL'ed images.weserv loading SSL'ed images from my domain returns "#35: SSL connect error". Any ideas where this is coming from? I'm using CloudFlare to tunnel my site through SSL with "https everywhere" setting on.

Comment by Andries Louw Wolthuizen (Webmaster, Images.weserv.nl - Image cache & resize proxy) on 1-2-2016 21:21:00

Hi Luuk,
We use cURL for fetching of the original images, maybe the certificate is bad, maybe the handshake didn't succeed, or something else happened. Error's from cURL are directly passed to aid in debugging.
Could you please test the origin host (the host that is responsible for the original image) with something like https://www.ssllabs.com/ssltest/ ? It will pinpoint errors pretty fast.
Let me know!

Comment by Luuk Lamers on 4-2-2016 21:04:00

Checked it out. ssktest doesn't seem to think there's a problem.
https://www.ssllabs.com/ssltest/analyze.html?d=dim.nl

Comment by Andries Louw Wolthuizen (Webmaster, Images.weserv.nl - Image cache & resize proxy) on 4-2-2016 22:24:00

Hi Luuk,
Thanks for giving your domain, I discovered there's a bug with certificate negotiation in the version of cURL that comes with CentOS 6.x, which our servers use. I updated cURL to the newest available version, and it seems to be solved now.
However, we have some aggresive caching in place, so you may need to try new url's (by adding &test=1 to them, for example).

Comment by Luuk Lamers on 5-2-2016 20:39:00

Glad to help ;)
I'm happy it works now.
Thanks (bedankt!)

Comment by apichaidot on 2-1-2017 2:37:00

I try to use prefix ssl:
https://images.weserv.nl/?url=ssl:f.ptcdn.info/133/031/000/1431060027-2015050823-o.png&h=300
and I got an error below.
Error 404: Server could parse the ?url= that you were looking for, error it got: Maximum (10) redirects followed
Original Link=https://f.ptcdn.info/133/031/000/1431060027-2015050823-o.png
Please help me

Comment by Andries Louw Wolthuizen (Webmaster, Images.weserv.nl - Image cache & resize proxy) on 2-1-2017 21:47:00

Hi apichaidot,
The link you gave is working here, could it be a temporary issue?
Let me know!

Comment by apichaidot on 3-1-2017 8:47:00

Hi Andries,
Now it works. thank for kindly support.

Original UserVoice Submission

@tdotholla

This comment has been minimized.

Show comment
Hide comment
@tdotholla

tdotholla May 6, 2017

I'm trying to pull this image:
https://scontent-lga3-1.xx.fbcdn.net/v/t1.0-1/c60.0.200.200/p200x200/15356713_359230487770414_5786763214325760286_n.jpg?oh=e6655b3b21d60b58777f81e6c5611016&oe=598B1B6B

over your proxy via your ssl: method, as follows:
https://images.weserv.nl/?url=ssl:scontent-lga3-1.xx.fbcdn.net/v/t1.0-1/c60.0.200.200/p200x200/15356713_359230487770414_5786763214325760286_n.jpg?oh=e6655b3b21d60b58777f81e6c5611016&oe=598B1B6B
and it fails:

Error 404: Server couldn't parse the ?url= that you were looking for, error it got: The requested URL returned error: 403 Forbidden

tdotholla commented May 6, 2017

I'm trying to pull this image:
https://scontent-lga3-1.xx.fbcdn.net/v/t1.0-1/c60.0.200.200/p200x200/15356713_359230487770414_5786763214325760286_n.jpg?oh=e6655b3b21d60b58777f81e6c5611016&oe=598B1B6B

over your proxy via your ssl: method, as follows:
https://images.weserv.nl/?url=ssl:scontent-lga3-1.xx.fbcdn.net/v/t1.0-1/c60.0.200.200/p200x200/15356713_359230487770414_5786763214325760286_n.jpg?oh=e6655b3b21d60b58777f81e6c5611016&oe=598B1B6B
and it fails:

Error 404: Server couldn't parse the ?url= that you were looking for, error it got: The requested URL returned error: 403 Forbidden

@kleisauke

This comment has been minimized.

Show comment
Hide comment
@kleisauke

kleisauke May 6, 2017

Member

@tdotholla Try to encode your URL first, like this.

Member

kleisauke commented May 6, 2017

@tdotholla Try to encode your URL first, like this.

@tdotholla

This comment has been minimized.

Show comment
Hide comment
@tdotholla

tdotholla May 7, 2017

Ah Kudos!!! Thank you for this service btw; really saves me on serving 'insecure' static images.

tdotholla commented May 7, 2017

Ah Kudos!!! Thank you for this service btw; really saves me on serving 'insecure' static images.

@swhkn

This comment has been minimized.

Show comment
Hide comment
@swhkn

swhkn Mar 14, 2018

hello, I have tried @kleisauke, but still doesnt work
here is my original link https://titipku.id:8444/images/user/0uNI6LjcviQCfpNcvktZbiX34pX2

is it not going to be worked using port number?

swhkn commented Mar 14, 2018

hello, I have tried @kleisauke, but still doesnt work
here is my original link https://titipku.id:8444/images/user/0uNI6LjcviQCfpNcvktZbiX34pX2

is it not going to be worked using port number?

@kleisauke

This comment has been minimized.

Show comment
Hide comment
@kleisauke

kleisauke Mar 15, 2018

Member

@swhkn We had restrictions on the port numbers that could be used with HTTPS-connections.

It should work now. The following list of safe ports are usable:

port 80          # http
port 21          # ftp
port 443         # https
port 70          # gopher
port 210         # wais
port 1025-65535  # unregistered ports
port 280         # http-mgmt
port 488         # gss-http
port 591         # filemaker
port 777         # multiling http

This also solves #10

Member

kleisauke commented Mar 15, 2018

@swhkn We had restrictions on the port numbers that could be used with HTTPS-connections.

It should work now. The following list of safe ports are usable:

port 80          # http
port 21          # ftp
port 443         # https
port 70          # gopher
port 210         # wais
port 1025-65535  # unregistered ports
port 280         # http-mgmt
port 488         # gss-http
port 591         # filemaker
port 777         # multiling http

This also solves #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment