Having issue with FIJI's switch to HTTPS

I updated my FIJI yesterday and started having problems with the updater. I get a stack dump every time I start FIJI. And, when I go to the Help | Update FIJI, it prompts to switch all of the URLs to https. If I let them get updated, all of them generate “connection reset” error messages. I’ve checked with other internal users and they seem to be getting the same issue.
I assume that there is a problem with my proxy settings. I’ve never been able to get it to work using “use system proxy”, so I’ve always manually entered my proxy server and port.

  1. Is there a way to switch back to non-http after FIJI has updated to https?
  2. I don’t even know where to begin for troubleshooting this. Are there any key questions I can ask my internal folks about our proxy settings to figure out where it may be going awry?

thanks!
Jeff

ps - Here is the stack dump that shows up when I start FIJI:

java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:210)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
	at net.imagej.updater.util.HTTPSUtil.checkHTTPSSupport(HTTPSUtil.java:40)
	at net.imagej.updater.UpToDate.check(UpToDate.java:113)
	at net.imagej.updater.UpToDate.check(UpToDate.java:86)
	at net.imagej.updater.CheckForUpdates.run(CheckForUpdates.java:63)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
[INFO] Reading available sites from https://imagej.net/
[ERROR] null
java.net.SocketException: Connection reset
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944)
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
	at net.imagej.util.MediaWikiClient.request(MediaWikiClient.java:234)
	at net.imagej.util.MediaWikiClient.query(MediaWikiClient.java:243)
	at net.imagej.util.MediaWikiClient.getPageSource(MediaWikiClient.java:109)
	at net.imagej.updater.util.AvailableSites.getAvailableSites(AvailableSites.java:70)
	at net.imagej.updater.util.AvailableSites.getAvailableSites(AvailableSites.java:60)
	at net.imagej.updater.util.AvailableSites.hasUpdateSiteURLUpdates(AvailableSites.java:262)
	at net.imagej.updater.UpToDate.check(UpToDate.java:114)
	at net.imagej.updater.UpToDate.check(UpToDate.java:86)
	at net.imagej.updater.CheckForUpdates.run(CheckForUpdates.java:63)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:210)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:3023)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFields(HttpsURLConnectionImpl.java:292)
	at net.imagej.util.MediaWikiClient.request(MediaWikiClient.java:223)
	... 17 more

Hi @jhanson,

I won’t be able to help much, but I bet that answers to these questions will be helpful to whoever can help you:

  1. What OS are you running?
  2. Do you still have the same issue when downloading a fresh fiji and trying to update?
  3. What happens if you use your browser to navigate to https://update.imagej.net/ ?

John

1 Like

Hi @jhanson,

sorry for the inconvenience and thank you for reporting the issue!

Do you get to the Updater window or does it not open because of the error? If you do and you can open the list of update sites, you can rewrite the active URLs back to HTTP. The URLs are stored in the Fiji.app/db.xml.gz, that’s another possibility to change the URLs. You could also download a fresh Fiji and click “Keep the current URLs” and “Remember to not update these URLs” when the window pops up to change them back to HTTPS.

BUT I would rather like to figure out how to fix the problem so that you can update via HTTPS using your proxy. At some point we might not ship updates via HTTP anymore. I have to figure out how to reproduce the issue and might come back with questions :slight_smile: Answering @bogovicj’s questions would also be super helpful.

1 Like

Thanks for the suggestions. Here’s some more info and the results of trying a few things:

  1. My OS is Win 10.
  2. A fresh FIJI install results in – a stack dump on startup (error reading https://imagej.net/). then, when I let it update the URLs, it says “Could not updates from site ‘ImageJ’:java.net.SocketException: Connection reset” and “Could not updates from site ‘Java-8’:java.net.SocketException: Connection reset”… then it lists a bunch of modules as “locally modified”… Switching the sites back to HTTP under Manage update sites removes the list of “locally modified”. But… nothing brings up the complete list of update sites.
  3. My browser has no trouble with https://update.imagej.net/
  4. On a fresh install, when I “Keep the current URLs” – Going to the Update…, it asked updating URLs to HTTPS, and I selected “Keep”. The manage update sites only listed 3 items - ImageJ, Fiji, Java-8. :frowning:
  5. I tried a fresh install based on a FIJI download from 3/25/2019. When it starts, it asked if I wanted to start the updater. If I say ‘remind me later’ and then try “Update…”… It updates FIJI and then asks me to restart ImageJ. Upon restarting, it generates the stack dump with the error about reading imagej.net. But… it did update a number of jars. But, after it finished, it asked me to restart again. After this last restart, it resulted in essentially the same state I ended up with from the “Fresh install” of FIJI from #2.

For now, we’re ok turning off updates and using the FIJI downloaded from 03/25/2019. But, it’d be nice if I could figure out what my proxy settings need to be to get it working again.

3 Likes

I had similar problems. When I looked closely I found two outdated java versions in my Fiji/java folder.
When I removed the java folder completely from Fiji, it fell back to my system’s OpenJDK installation and everything started working again.

1 Like

@Stoyan_Pavlov Good to know. What would be helpful would be to know which versions of Java those were—i.e., which version(s) of Java behaved badly with the Updater updates, and which version(s) of Java are behaving well. @frauzufall Correct me if I am wrong, but I think our goal is for the Updater to behave nicely for any version of Java 8, even too-old versions—where “nicely” here means “doing the right thing if Java is new enough, and asking the user to upgrade their Java if it is too old.” Right?

There were two java folders there in the Fiji/java:
openjdk_1_8_66
and openjdk_1_8_172
I however didn’t experiment to see which one or whether their combined presence was responsible. Just removed them and Fiji started using the last OpenJDK version installed on my Windows 10 OS.

1 Like

Yes, this error should not appear for just using an old Java version. In my tests and what I got from others, only the SSLHandshakeException appeared in case Java would not support the protocol. I tried other versions than @Stoyan_Pavlov though. The updater can catch the SocketException and use HTTP in this case too, I will add that.

1 Like

Thanks for all the details! Some more questions:

  • does your proxy cover both HTTP and HTTPS? (I am wondering why this was not an issue in the past)
  • do you use the plugin Edit > Options > Proxy Settings...?

With the help of people with the same issue I became aware of this plugin (duh) and found out that there are proxy system variables which are only set for HTTP. I changed the IJ1 code to include the HTTPS variables but this only slightly improved the situation (they could update one time without issues but after restarting Fiji the same error came up).

In case anyone wants to try, but no promises:

  • download this ij-1.52p.jar version or build it yourself using this branch and replace the one in Fiji.app/jars with it
  • open Edit > Options > Proxy Settings... and set your proxy settings (assuming you have the same settings for HTTP and HTTPS)
  • restart Fiji, try to update

Next week I will go to the institute in Dresden with the same issue and do further testing. In the meantime, any additional observations are welcome.

1 Like

Ok, for anyone with proxy issues (@jhanson), can you please try if this ij-1.52p.jar version fixes the issue? You have to replace the one in Fiji.app.jars.

@Wayne could you please have a look at the changes I made to IJ1 in order to use HTTPS proxies?

Best,
Deborah

Thanks! I tried it and the changes you made seem to have resolved the issue.
The ImageJ updater now shows me all of the update sites (it successfully read from https://imagej.net/).
It prompted me once for a proxy username and password and generated an exception. But, it only happened the very first time (and I didn’t record it).
I was able to switch the ImageJ, Fiji and Java-8 to use https and everything still worked.

1 Like

Hi,
recently I also had proxy issues (see this post).

On Win10 / jdk1.8.0_201 and the new ij-152p.jar the updater works fine if I configure the proxy manually in the options and uncheck “Or, use system proxy settings”. If I additionally check that box I receive UnknownHost exceptions when running the updater. The environment variables http_proxy and https_proxy seem to have no effect.

On CentOS 7 / jdk1.8.0_172 I can either set the environment variable http_proxy and https_proxy and use the “use system proxy” option or manually configure the proxy (or both). In both cases the updater works fine.

Thanks for the update !

1 Like