Skip to content

Commit 5c8c9aa

Browse files
cblichmanncopybara-github
authored andcommitted
UI: Fix update checker TLS version
Since BinDiff does not ship with a full JDK, but with a stripped down JRE, SSL/TLS config files are omitted. This change forces TLS v1.2 for the update check to prevent "Could not check for update. The update site returned no data." errors. PiperOrigin-RevId: 377357578 Change-Id: If1d6d6b85f70d26ab56c411707e78ba2c40777ff
1 parent 96b299d commit 5c8c9aa

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

java/ui/src/main/java/com/google/security/zynamics/bindiff/BinDiff.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ private BinDiff() {}
9595
// Do nothing. macOS integration will be sub-optimal but there's nothing we can meaningfully
9696
// do here.
9797
}
98+
try {
99+
// For the update check: force the use of a recent TLS version. TLS 1.3 is not generally
100+
// usable yet.
101+
System.setProperty("https.protocols", "TLSv1.2");
102+
} catch (final SecurityException e) {
103+
/* Ignore */
104+
}
98105
}
99106

100107
public static boolean isDesktopIntegrationDone() {

java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/license/UpdateCheckHelper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ protected void runExpensiveCommand() throws Exception {
112112
parent, "Could not check for updates. The update site is unavailable.");
113113
return;
114114
}
115+
if (e != null) {
116+
CMessageBox.showWarning(
117+
parent, "Could not check for updates: " + e.getMessage());
118+
return;
119+
}
115120

116121
if (lines.isEmpty()) {
117122
CMessageBox.showWarning(

0 commit comments

Comments
 (0)