Skip to content

Updated HTTPS downloader to work with older Java versions#1

Merged
ftadel merged 3 commits intobrainstorm-tools:masterfrom
martcous:https_neuroimage_fix
Aug 22, 2018
Merged

Updated HTTPS downloader to work with older Java versions#1
ftadel merged 3 commits intobrainstorm-tools:masterfrom
martcous:https_neuroimage_fix

Conversation

@martcous
Copy link
Copy Markdown
Member

When I started integrating downloads from GitHub repositories in Brainstorm, I ran into the problem of the fact that GitHub forces downloads through a TLS 1.2 connection, which is only supported by Java 1.7+. So I disabled HTTPS downloads for older Java versions.

Now that NeuroImage.usc.edu is under HTTPS as well, this is obviously an issue for most other downloads as well under Java 1.6. I therefore implemented a non-TLS connection for non-GitHub Java 1.6 HTTPS downloads. I however ran into another problem of very old versions of Java 1.6.0 (which ships with Matlab 2008a and probably others) rejecting NeuroImage's SSL certificate... So I went with the proposed solution here and added a "trust all certificates" option to our SSL download connection for Java 1.6.

This is obviously completely insecure but I think as long as we're in control of what URLs are added in the public Brainstorm repo it shouldn't be an issue (also keep in mind that this is only for old supported Matlab versions with Java 1.6).

In my early tests it's working fine for our oldest and newest supported Matlab and Java versions. If you're fine with the solution I'll go ahead and do more extensive tests.

@martcous martcous requested a review from ftadel August 15, 2018 17:09
@ftadel
Copy link
Copy Markdown
Member

ftadel commented Aug 15, 2018

If you think this is OK, go ahead.
Make sure you test it to download all the files Brainstorm need to download (search for calls to DownloadFile), with various versions of Matlab between 2008a and 2018a.

Let me know when I should recompile it and update it in the Brainstorm distribution.

@martcous
Copy link
Copy Markdown
Member Author

OK I fixed a HUGE slowdown in download speeds, there was a lot of overhead in the I/O saving operation. Now updates are much faster to download and work from Matlab 2008 upwards (legacy Java is painful...) Ready to merge on my end!

@ftadel ftadel merged commit 747bcf2 into brainstorm-tools:master Aug 22, 2018
@ftadel
Copy link
Copy Markdown
Member

ftadel commented Aug 22, 2018

I tested it on Matlab 2018a and 2008a (Win10).
It works great, it's really significantly faster for downloading the 65Mb update .zip!
Thanks!

Pushed to the main distribution here:
brainstorm-tools/brainstorm3@1cb7e1c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants