0

I'm trying to clone and build a GitHub repo using Bazel, but a dependency requires an old verson of zlib via an outdated URL. I've already spent a few hours trying to do things like messing with the /etc/hosts file and running a web server to get it to work. I've gotten zlib.net to point to localhost, then running a web server on localhost:80 with zlib at the correct path, but that's not working, since the request is timing out.

I've googled it and only about 3 remotely relevant results have popped up, none of which are helpful.

How do I get it to build?

This is the error:

Error in download_and_extract: java.io.IOException: Error downloading [https://zlib.net/zlib-1.2.11.tar.gz] to /private/var/tmp/_bazel_user/37df51594c7eac8a62dd677a22c5514b/external/zlib/temp16216011345324291299/zlib-1.2.11.tar.gz: GET returned 404 Not Found
shreyasm-dev
  • 2,711
  • 5
  • 16
  • 34
  • An incredibly farfetched Java approach may be to add a `SecurityManager` and attempt to override the URL used in the connection. Honestly not sure if this would work but it's just a thought – Ben Anderson Dec 07 '22 at 00:48
  • I'm having the same problem building a repo. I can't seem to find where that URL is set so I can change it. – aneccodeal Jan 31 '23 at 18:05

1 Answers1

1

It is timing out because the request uses HTTPS, which is port 443, not HTTP on port 80. You can use a similar approach to what you are doing (with the hosts file) but just run a HTTPS server on port 443.

This can be achieved using tools such as ngrok and your current localhost web server.

Ben Anderson
  • 496
  • 4
  • 11
  • I was using HTTPS, but turns out I had something configured wrong with the certificate I was using. I'll mark your answer as correct since it's still relevant. – shreyasm-dev Dec 07 '22 at 01:35