Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/net/imagej/updater/util/HTTPSUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.UnknownHostException;
Expand Down Expand Up @@ -56,6 +57,12 @@ public static void checkHTTPSSupport(LogService log) {
"Please contact your system administrator to enable communication via HTTPS.";
if (log != null) log.warn(msg);
else System.out.println("[WARNING] " + msg);
} catch (SocketException e) {
secureMode = false;
String msg = "SocketException while trying to update securely via HTTPS. Will fall back to HTTP. This is a security risk. " +
"Try downloading a new version of this software. If you're behind a proxy, call Edit > Options > Proxy Settings.";
if (log != null) log.warn(msg);
else System.out.println("[WARNING] " + msg);
} catch (IOException e) {
e.printStackTrace();
}
Expand Down