gdi_free(instance);
/* Only close the connection if NLA fallback process is done */
- if (!context->during_connect_process)
+ if (!context->allow_next_conn_failure)
proxy_data_abort_connect(pdata);
}
pClientContext* pc = (pClientContext*) instance->context;
rdpSettings* settings = pc->context.settings;
- /* on first try, proxy client should always try to connect with NLA */
- settings->NlaSecurity = TRUE;
- pc->during_connect_process = TRUE;
+ /* if credentials are available, always try to connect with NLA on first try */
+ if (settings->Username && settings->Password)
+ {
+ settings->NlaSecurity = TRUE;
+ pc->allow_next_conn_failure = TRUE;
+ }
+ else
+ settings->NlaSecurity = FALSE;
if (!freerdp_connect(instance))
{
settings->RdpSecurity = TRUE;
settings->TlsSecurity = TRUE;
- pc->during_connect_process = FALSE;
+ pc->allow_next_conn_failure = FALSE;
if (!freerdp_connect(instance))
{
WLog_ERR(TAG, "connection failure");
}
}
- pc->during_connect_process = FALSE;
+ pc->allow_next_conn_failure = FALSE;
return TRUE;
}
* It must be set to TRUE before the first try, and to FALSE after the connection fully established,
* to ensure graceful shutdown of the connection when it will be closed.
*/
- BOOL during_connect_process;
+ BOOL allow_next_conn_failure;
};
typedef struct p_client_context pClientContext;