As explained by ilian in his comment to my question, one can work around these issues in the following way
Mathematica 8
You need to switch to a different version of Java as the one used in Mathematica by default.
Linux
The standard JVM of your Linux system should be fine. On my system (Fedora 30) it is currently OpenJDK 1.8.0
$/usr/bin/java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
So in Mathematica we first need to run the following code
<< JLink`
ReinstallJava[CommandLine -> "/usr/bin/java"]
which (in my case) returns
LinkObject[/usr/bin/java -classpath "/media/Data/Software/Mathematica/8.0/SystemFiles/Links/JLink/JLink.jar" -Xmx256m -Djava.system.class.loader=com.wolfram.jlink.JLinkSystemClassLoader -Djava.util.prefs.PreferencesFactory=com.wolfram.jlink.DisabledPreferencesFactory com.wolfram.jlink.Install -init "/tmp/m00000291671",7,4]
After that
<< Utilities`URLTools`
FetchURL["https://codeload.github.com/WolframResearch/\
WolframLanguageForJupyter/zip/master"]
works as expected. Notice that you need to load JLink and use ReinstallJava each time you start the kernel and want to use FetchURL.
Windows 10
You need to install a JVM (I used jre-8u231-windows-x64.exe from java.com) first. Then execute something like
<< JLink`
ReinstallJava[CommandLine -> "C:\\Program Files\\Java\\jre1.8.0_231\\bin\\java.exe"]
before using FetchURL. Notice that you might need to adjust the path to java.exe accordingly
Mathematica 9
Linux
Here you need to do some work already when starting Mathematica and use LD_PRELOAD to preload libcurl.so On my system (Fedora 30) I have libcurl.so.4.5.0 installed.
So we run Mathematica as
LD_PRELOAD=/usr/lib64/libcurl.so.4.5.0 mathematica9.0
and
URLSave["https://codeload.github.com/WolframResearch/\
WolframLanguageForJupyter/zip/master", CreateTemporary[]]
just works. Setting "VerifyPeer" -> False as originally suggested by ilian seems unnecessary here, but perhaps it might be needed for other links.
Windows 10
The current workaround (as suggested by ilian) is to use powershell instead of the built-in URLSave. You can use something like
URLSave2[url_String, file_String]:=
If[ Run["powershell.exe -command iwr -outf " <> file <> " " <> url]===0,
file,
$Failed
]
to get it working as in
URLSave2["https://codeload.github.com/WolframResearch/\
WolframLanguageForJupyter/zip/master", CreateTemporary[]]
ReinstallJava[CommandLine -> "/usr/bin/java"]and then tryFetchURLagain. V9 is trickier, the best I could think of right now is replace libcurl.so with a newer one (could be done viaLD_PRELOADtoo) and add"VerifyPeer" -> False. $\endgroup$install.mfrom GitHub. But in any case these are valid workarounds that should help other Linux users facing similar problems. If you like, you can turn your comment into an answer that I would accept. I could also do it if you have no time for that. The main point is that someone googling for this issue should find this question straight away. $\endgroup$LD_PRELOAD-trick one could use on Windows 10 for Mathematica 9? $\endgroup$