Changeset 14999 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2019-04-19T01:07:53+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java
r14498 r14999 189 189 "https://eidas.disig.sk"), 190 190 // Government of Taiwan - https://grca.nat.gov.tw/GRCAeng/index.html 191 new NativeCertAmend(" Government Root Certification Authority", "Government Root Certification Authority", "Taiwan_GRCA.pem",191 new NativeCertAmend("TW Government Root Certification Authority", "Government Root Certification Authority", "Taiwan_GRCA.pem", 192 192 "7600295eefe85b9e1fd624db76062aaaae59818a54d2774cd4c0b2c01131e1b3", 193 193 "https://grca.nat.gov.tw") -
trunk/src/org/openstreetmap/josm/io/OnlineResource.java
r14624 r14999 17 17 /** The JOSM website, used for startup page, imagery/presets/styles/rules entries, help, etc. */ 18 18 JOSM_WEBSITE(tr("JOSM website")), 19 /** Various government certificates downloaded on Windows to make https imagery work in some countries */ 20 CERTIFICATES(tr("Certificates")), 19 21 /** Value used to represent all online resources */ 20 22 ALL(tr("All")); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r14622 r14999 87 87 import org.openstreetmap.josm.gui.MainApplication; 88 88 import org.openstreetmap.josm.io.CertificateAmendment.NativeCertAmend; 89 import org.openstreetmap.josm.io.NetworkManager; 90 import org.openstreetmap.josm.io.OnlineResource; 89 91 import org.openstreetmap.josm.spi.preferences.Config; 90 92 … … 479 481 // Search by alias (fast) 480 482 Certificate result = ks.getCertificate(certAmend.getWinAlias()); 481 if (result == null ) {483 if (result == null && !NetworkManager.isOffline(OnlineResource.CERTIFICATES)) { 482 484 // Make a web request to target site to force Windows to update if needed its trust root store from its certificate trust list 483 485 // A better, but a lot more complex method might be to get certificate list from Windows Registry with PowerShell … … 495 497 MessageDigest md = MessageDigest.getInstance("SHA-256"); 496 498 for (Enumeration<String> aliases = ks.aliases(); aliases.hasMoreElements();) { 497 result = ks.getCertificate(aliases.nextElement()); 499 String alias = aliases.nextElement(); 500 result = ks.getCertificate(alias); 498 501 if (result instanceof X509Certificate 499 502 && certAmend.getSha256().equalsIgnoreCase(Utils.toHexString(md.digest(result.getEncoded())))) { 503 Logging.warn("Certificate not found for alias ''{0}'' but found for alias ''{1}''", certAmend.getWinAlias(), alias); 500 504 return (X509Certificate) result; 501 505 }
Note:
See TracChangeset
for help on using the changeset viewer.