private boolean isMatchingEndpointDescription(EndpointDescription endpointDescription) {
        if (isMatchingEndpoint(endpointDescription, driverContext.getHost(), driverContext.getPort(), driverContext.getTransportEndpoint())) {
            return true;
        }
        if (configuration.getEndpointHost() != null) {
            return isMatchingEndpoint(endpointDescription, configuration.getEndpointHost(), configuration.getEndpointPort() == null ? driverContext.getPort() : String.valueOf(configuration.getEndpointPort()), driverContext.getTransportEndpoint());
        } else if (configuration.getEndpointPort() != null) {
            return isMatchingEndpoint(endpointDescription, driverContext.getHost(), configuration.getEndpointPort().toString(), driverContext.getTransportEndpoint());
        }
        return false;
    }
Selects the endpoint and authentication policy based on client settings.

@param extensionObjects Endpoint descriptions returned by the server.
@param securityPolicy Security policy searched in endpoints.
@param messageSecurity Message security needed by client.
@return Endpoint matching given.
plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/context/SecureChannel.java