Closed eserte closed 3 years ago
Thank you very much for the ticket. I have seen these failures on cpantesters, but had so far assumed that the 301 as caused because of some strange network configuration causing github URLs to be redirected. Having this information however makes it clear that the issue is that https is missing from LWP and (I assume) LWP rewriting my https url to http since it can't do https. I will be investigating how to handle this case for the next version.
Finally got to do some digging, turns out I was on the right path but wrong assumption. The culprit actually is File::Fetch's iosock method, which is using IO::Socket to open a connection to port 80, and only port 80, and download the file. Since github always does a redirect to https, that's where the error "expected 200 got 301" comes from. Installing LWP::Protocol::https happened to work because it installed LWP. I've confirmed that LWP will skip if it can't do https and File::Fetch will move on. The bug would also go away when any other method is available, so an apt-get install curl or wget would have also fixed it.
I still need to figure out a solution. While I could skip all https downloads in the test, I'm hesitant to since the module pretty heavily relies on https to be useful.
I ended up adding a function to check if https was supported, and if not, skips those tests. I'm not sure there was any other way. Closing as this was released as part of 0.27.
In a minimal docker setup using debian/stretch (stable) the test suite fails. The Dockerfile:
The failing tests:
The first two failing tests are fixed by installing LWP::Protocol::https before (see the commented out RUN line in the Dockerfile). The third test still fails (and probably should dealt into another issue).