/** * Determines the insecure port to bind to. * <p> * The port is determined by invoking {@code HonoConfigProperties#getInsecurePort(int)} * with the value returned by {@link #getInsecurePortDefaultValue()}. * * @return The port. */ protected final int determineInsecurePort() { final int insecurePort = getConfig().getInsecurePort(getInsecurePortDefaultValue()); if (insecurePort == 0) { LOG.info("Server found insecure port number configured for ephemeral port selection (port chosen automatically)."); } else if (insecurePort == getInsecurePortDefaultValue()) { LOG.info("Server uses standard insecure port {}", insecurePort); } else if (insecurePort == getPortDefaultValue()) { LOG.warn("Server found insecure port number configured to standard port for secure connections {}", getConfig().getInsecurePort()); LOG.warn("Possibly misconfigured?"); } return insecurePort; }
/** * Determines the insecure port to bind to. * <p> * The port is determined by invoking {@code HonoConfigProperties#getInsecurePort(int)} * with the value returned by {@link #getInsecurePortDefaultValue()}. * * @return The port. */ protected final int determineInsecurePort() { final int insecurePort = getConfig().getInsecurePort(getInsecurePortDefaultValue()); if (insecurePort == 0) { LOG.info("Server found insecure port number configured for ephemeral port selection (port chosen automatically)."); } else if (insecurePort == getInsecurePortDefaultValue()) { LOG.info("Server uses standard insecure port {}", insecurePort); } else if (insecurePort == getPortDefaultValue()) { LOG.warn("Server found insecure port number configured to standard port for secure connections {}", getConfig().getInsecurePort()); LOG.warn("Possibly misconfigured?"); } return insecurePort; }
if (getConfig().getPort(getPortDefaultValue()) == getConfig().getInsecurePort(getInsecurePortDefaultValue())) { LOG.error("secure and insecure ports must be configured to bind to different port numbers"); result.fail("secure and insecure ports configured to bind to same port number");
if (getConfig().getPort(getPortDefaultValue()) == getConfig().getInsecurePort(getInsecurePortDefaultValue())) { LOG.error("secure and insecure ports must be configured to bind to different port numbers"); result.fail("secure and insecure ports configured to bind to same port number");
/** * Gets the insecure port number that this service has bound to. * <p> * The port number is determined as follows: * <ol> * <li>if this service is already listening on an insecure port, the corresponding socket's actual port number is returned, else</li> * <li>if this service has been configured to listen on an insecure port, the configured port number is returned, else</li> * <li>{@link Constants#PORT_UNCONFIGURED} is returned.</li> * </ol> * * @return The port number. */ public final int getInsecurePort() { if (getActualInsecurePort() != Constants.PORT_UNCONFIGURED) { return getActualInsecurePort(); } else if (isInsecurePortEnabled()) { return getConfig().getInsecurePort(getInsecurePortDefaultValue()); } else { return Constants.PORT_UNCONFIGURED; } }
/** * Gets the insecure port number that this service has bound to. * <p> * The port number is determined as follows: * <ol> * <li>if this service is already listening on an insecure port, the corresponding socket's actual port number is returned, else</li> * <li>if this service has been configured to listen on an insecure port, the configured port number is returned, else</li> * <li>{@link Constants#PORT_UNCONFIGURED} is returned.</li> * </ol> * * @return The port number. */ public final int getInsecurePort() { if (getActualInsecurePort() != Constants.PORT_UNCONFIGURED) { return getActualInsecurePort(); } else if (isInsecurePortEnabled()) { return getConfig().getInsecurePort(getInsecurePortDefaultValue()); } else { return Constants.PORT_UNCONFIGURED; } }