SSL errors when using URLFetch or URLSave in versions 8 or 9


It seems that with Mathematica 8 and 9 it is not possible anymore to download files from SSL encrypted urls. In my case (Fedora 30) on Mathematica 8 (it has no URLSave yet) I get

<< Utilities`URLTools`
FetchURL::conopen: The connection to URL cannot be opened. If the URL is correct, you might need to configure your firewall program, or you might need to set a proxy in the Internet connectivity tab of the Preferences dialog (or by calling SetInternetProxy).  For HTTPS connections, you might need to inspect the authenticity of the server's SSL certificate and choose to accept it.

While on Mathematica 9 evaluating

WolframLanguageForJupyter/zip/master", CreateTemporary[]]


During evaluation of In[15]:= URLSave::invhttp: SSL connect error. >>

Out[15]= $Failed

I wonder if there are any workarounds available since WRI is obviously not going to provide any patches for such old Mathematica versions. I also asked a similar question regarding Mathematica 10 here.


Posted 2020-01-06T14:09:50.663

Reputation: 3 088

4For V8, you can try a different version of Java, something like ReinstallJava[CommandLine -> "/usr/bin/java"] and then try FetchURL again. V9 is trickier, the best I could think of right now is replace with a newer one (could be done via LD_PRELOAD too) and add "VerifyPeer" -> False. – ilian – 2020-01-08T02:26:26.907

Many thanks! Both tricks work, although I'm a bit unsure if they are simple enough for an average user to install FeynCalc via install.m from 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. – vsht – 2020-01-08T09:24:23.247

It's totally fine if you want to make this into an answer. I believe the Java workaround is quite reasonable, unlike the other one. I'll post an update in case I can come up with a less heavy-handed way to handle the V9 problem. – ilian – 2020-01-08T23:07:34.633

Done. Thanks again for your help. – vsht – 2020-01-09T13:30:57.850

@ilian Seems that not only Linux is affected but also Windows 10 and Mac OS. Is there something like LD_PRELOAD-trick one could use on Windows 10 for Mathematica 9? – vsht – 2020-01-12T01:08:31.543

Windows is more complicated... I have one idea that might help but it will take time to test and I need to coordinate with other people. In the meantime, perhaps it is a bit of cheating, but how about something like Run["powershell.exe -command iwr -outf"] – ilian – 2020-01-15T01:53:09.857

@ilian, many thanks, the workaround seems to work just fine. I updated my answer accordingly to have it included. – vsht – 2020-01-20T18:01:37.733



Just an addendum for Mathematica 9 on Windows and Linux (Mac should already work).

The problem can be resolved by installing an updated version of the HTTPClient paclet and restarting the kernel, for example

Map[PacletSiteUpdate, PacletSites[]];


(* Out[2]= Paclet[HTTPClient, 9.0.1, <>] *)


Subsequently this should work without any SSL errors

In[1]:= $Version                                                                

Out[1]= 9.0 for Linux x86 (64-bit) (February 7, 2013)

In[2]:= URLFetch["", "StatusCode"]                    

Out[2]= 200    


Posted 2020-01-06T14:09:50.663

Reputation: 24 492

1Thanks so much for fixing Mma 9! – vsht – 2020-01-29T22:13:52.857


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.


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`

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 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


Here you need to do some work already when starting Mathematica and use LD_PRELOAD to preload On my system (Fedora 30) I have installed. So we run Mathematica as

LD_PRELOAD=/usr/lib64/ mathematica9.0


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,

to get it working as in

WolframLanguageForJupyter/zip/master", CreateTemporary[]]


Posted 2020-01-06T14:09:50.663

Reputation: 3 088