Changeset 7337 in josm


Ignore:
Timestamp:
2014-07-26T16:36:43+02:00 (5 years ago)
Author:
Don-vip
Message:

see #10230, see #10033 - SAN tweaks + fix unit test (for real?)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r7335 r7337  
    7979    private SSLContext sslContext;
    8080
    81     private static final String KEYSTORE_FILENAME = "josm.keystore";
     81    private static final int HTTPS_PORT = 8112;
     82
     83    /**
     84     * JOSM keystore file name.
     85     * @since 7337
     86     */
     87    public static final String KEYSTORE_FILENAME = "josm.keystore";
    8288
    8389    /**
     
    196202                    KeyPair pair = generator.generateKeyPair();
    197203
    198                     X509Certificate cert = generateCertificate("CN=localhost, OU=JOSM, O=OpenStreetMap", pair, 1825, "SHA256withRSA", "ip:127.0.0.1");
     204                    X509Certificate cert = generateCertificate("CN=localhost, OU=JOSM, O=OpenStreetMap", pair, 1825, "SHA256withRSA",
     205                            "ip:127.0.0.1,dns:localhost,uri:https://127.0.0.1:"+HTTPS_PORT);
    199206
    200207                    KeyStore ks = KeyStore.getInstance("JKS");
     
    255262     */
    256263    public static void restartRemoteControlHttpsServer() {
    257         int port = Main.pref.getInteger("remote.control.https.port", 8112);
     264        int port = Main.pref.getInteger("remote.control.https.port", HTTPS_PORT);
    258265        try {
    259266            stopRemoteControlHttpsServer();
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r7335 r7337  
    262262            }
    263263        }
    264         // JOSM certificate not found, install it
     264        // JOSM certificate not found, install it to Windows-ROOT keystore, used by IE, Chrome and Safari, but not by Firefox
    265265        Main.info(tr("Adding JOSM localhost certificate to {0} keystore", WINDOWS_ROOT));
    266266        ks.setEntry("josm_localhost", trustedCert, null);
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java

    r7336 r7337  
    1313import java.net.URL;
    1414import java.nio.charset.StandardCharsets;
     15import java.nio.file.Files;
     16import java.nio.file.Paths;
    1517import java.security.GeneralSecurityException;
    1618import java.security.SecureRandom;
     
    4547        JOSMFixture.createUnitTestFixture().init();
    4648        RemoteControl.PROP_REMOTECONTROL_HTTPS_ENABLED.put(true);
     49        try {
     50            Files.deleteIfExists(Paths.get(
     51                    RemoteControl.getRemoteControlDir()).resolve(RemoteControlHttpsServer.KEYSTORE_FILENAME));
     52        } catch (IOException e) {
     53            Main.error(e);
     54        }
     55
    4756        RemoteControl.start();
    4857        disableCertificateValidation();
Note: See TracChangeset for help on using the changeset viewer.