Changeset 12458 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2017-07-08T22:11:07+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/remotecontrol
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r12253 r12458 51 51 import sun.security.x509.CertificateVersion; 52 52 import sun.security.x509.CertificateX509Key; 53 import sun.security.x509.DNSName; 53 54 import sun.security.x509.ExtendedKeyUsageExtension; 54 55 import sun.security.x509.GeneralName; … … 109 110 110 111 /** 111 * Creates a GeneralName object from known types.112 * Creates a GeneralNameInterface object from known types. 112 113 * @param t one of 4 known types 113 114 * @param v value … … 115 116 * @throws IOException if any I/O error occurs 116 117 */ 117 private static GeneralName createGeneralName(String t, String v) throws IOException { 118 GeneralNameInterface gn; 118 private static GeneralNameInterface createGeneralNameInterface(String t, String v) throws IOException { 119 119 switch (t.toLowerCase(Locale.ENGLISH)) { 120 case "uri": gn = new URIName(v); break; 121 case "dns": gn = new DNSNameFix(v); break; 122 case "ip": gn = new IPAddressName(v); break; 123 default: gn = new OIDName(v); 124 } 125 return new GeneralName(gn); 120 case "uri": return new URIName(v); 121 case "dns": return new DNSName(v); 122 case "ip": return new IPAddressName(v); 123 default: return new OIDName(v); 124 } 126 125 } 127 126 … … 174 173 String t = item.substring(0, colonpos); 175 174 String v = item.substring(colonpos+1); 176 gnames.add( createGeneralName(t, v));175 gnames.add(new GeneralName(createGeneralNameInterface(t, v))); 177 176 } 178 177 // Non critical … … 220 219 221 220 X509Certificate cert = generateCertificate("CN=localhost, OU=JOSM, O=OpenStreetMap", pair, 1825, "SHA256withRSA", 222 // see #10033#comment:20: All browsers respect "ip" in SAN, except IE which only understands DNS entries: 223 // CHECKSTYLE.OFF: LineLength 224 // https://connect.microsoft.com/IE/feedback/details/814744/the-ie-doesnt-trust-a-san-certificate-when-connecting-to-ip-address 225 // CHECKSTYLE.ON: LineLength 226 "dns:localhost,ip:127.0.0.1,dns:127.0.0.1,ip:::1,uri:https://127.0.0.1:"+HTTPS_PORT+",uri:https://::1:"+HTTPS_PORT); 221 "dns:localhost,ip:127.0.0.1,ip:::1,uri:https://127.0.0.1:"+HTTPS_PORT+",uri:https://::1:"+HTTPS_PORT); 227 222 228 223 KeyStore ks = KeyStore.getInstance("JKS");
Note:
See TracChangeset
for help on using the changeset viewer.