Opening images from the forum via URL

imagej

#1

Before the ImageJ and CellProfiler forums were merged, it was possible to open images from forum posts via their URL (e.g. in ImageJ via File > Import > URL…).

Now, when I try to open an URL such as this one:
https://discourse-cdn-sjc1.com/business4/uploads/imagej/optimized/2X/e/e51b4b7896931761ab2ac2286611a2c2c0c989b3_1_403x500.png

open("https://discourse-cdn-sjc1.com/business4/uploads/imagej/optimized/2X/e/e51b4b7896931761ab2ac2286611a2c2c0c989b3_1_403x500.png");

I get the following exception, indicating a 451 Unavailable For Legal Reasons error.

(Fiji Is Just) ImageJ 2.0.0-rc-68/1.52e; Java 1.8.0_172 [64-bit]; Windows 7 6.1; 1748MB of 87332MB (2%)
 
java.io.IOException: Server returned HTTP response code: 451 for URL: https://discourse-cdn-sjc1.com/business4/uploads/imagej/optimized/2X/e/e51b4b7896931761ab2ac2286611a2c2c0c989b3_1_403x500.png
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
	at java.net.URL.openStream(URL.java:1045)
	at ij.io.Opener.openPngUsingURL(Opener.java:622)
	at ij.io.Opener.openURL(Opener.java:438)
	at ij.ImagePlus.<init>(ImagePlus.java:131)
	at ij.plugin.URLOpener.run(URLOpener.java:83)
	at ij.IJ.runPlugIn(IJ.java:198)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:63)
	at java.lang.Thread.run(Thread.java:748)

Does anybody know if that’s something that can be configured in Discourse, or if that’s related to the server settings of discourse-cdn-sjc1.com?


#2

I can open it just fine. Just to confirm that I opened the right picture, it looks like a black and white zigzag puzzle.

I also looked up the code 451, here is what it says on wikipedia:
In computer networking, HTTP 451 Unavailable For Legal Reasons is an error status code of the HTTP protocol to be displayed when the user requests a resource which cannot be served for legal reasons, such as a web page censored by a government.


#3

I had seen this, that’s why I had included the link to wikipedia in my original post :wink:

You mean via Import > URL…? My browser displays it just fine as well, it is just when I try to use ImageJ in the way described that I see the error message.

Can anyone else reproduce it?


#4

I can confirm that in Fiji opening via Import > URL … fails.
The error message I get seems to look different though.

(Fiji Is Just) ImageJ 2.0.0-rc-68/1.52e; Java 1.8.0_66 [64-bit]; Windows 7 6.1; 46MB of 6022MB (<1%)

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
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:1513)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at java.net.URL.openStream(URL.java:1038)
at ij.io.Opener.openPngUsingURL(Opener.java:622)
at ij.io.Opener.openURL(Opener.java:438)
at ij.ImagePlus.(ImagePlus.java:131)
at ij.plugin.URLOpener.run(URLOpener.java:83)
at ij.IJ.runPlugIn(IJ.java:198)
at ij.Executer.runCommand(Executer.java:137)
at ij.Executer.run(Executer.java:66)
at java.lang.Thread.run(Thread.java:745)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
… 21 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
… 27 more