mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Tim "Docteur" Caillot
10.28.2020 c6c2d0558c89c799e228e1b5da962123845fc80f
OpenDJ doc specify "localhost" as default (#127)

The current code can return an IP or hostname instead of localhost, which means that using a script in local on a server which only listens to 127.0.0.1 can fail without the -h flag.
1 files modified
7 ■■■■ changed files
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConnectionFactoryProvider.java 7 ●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConnectionFactoryProvider.java
@@ -187,12 +187,7 @@
            argumentParser.addLdapConnectionArgument(useStartTLSArg);
        }
        String defaultHostName;
        try {
            defaultHostName = InetAddress.getLocalHost().getHostName();
        } catch (final Exception e) {
            defaultHostName = "Unknown (" + e + ")";
        }
        String defaultHostName = "localhost";
        hostNameArg = hostNameArgument(defaultHostName);
        argumentParser.addLdapConnectionArgument(hostNameArg);