goldfinger icon indicating copy to clipboard operation
goldfinger copied to clipboard

Retry to use http when OpenSSL::SSL::SSLError raises

Open yoshimov opened this issue 7 years ago • 4 comments

We are using http for mastodon instance inside of the company, but when the instance opens port 443 or uses different port from 80, goldfinger library fail to fetch the webfinger because of SSLError. Could you retry to use http when the OpenSSL::SSL::SSLError raises?

yoshimov avatar May 12 '17 09:05 yoshimov

I am not sure if this is a safe change. If there is no SSL, that's one thing, but SSLError could also be because the certificate is unverified, which might be a MITM attack - in which case falling back to http is not wise.

Gargron avatar May 13 '17 20:05 Gargron

Thank you for the comment. I believe there is no module that aware the differences of Goldfinger::NotFoundError and Goldfinger::SSLError. And the temporal down of the instance also causes HTTPError, so we should treat these errors as same. Moreover, if the instance is using redirection of the http port to https port, there is no MITM threat, and I think the most of public instances are using redirection.

yoshimov avatar May 14 '17 15:05 yoshimov

I just updated to retry with http only when the LOCAL_HTTPS setting is not true.

yoshimov avatar May 19 '17 03:05 yoshimov

I am working on a federation testsuite and want to implement mastodon as well. Since all federation tests happen in a docker environment.. using SSL is a bit much overhead.

I am also interested in using LOCAL_HTTPS as a ssl switch :+1:

zauberstuhl avatar Mar 08 '18 18:03 zauberstuhl