Bug 504282 - KRDC can't resolve hostname over socks proxy
Summary: KRDC can't resolve hostname over socks proxy
Status: RESOLVED FIXED
Alias: None
Product: krdc
Classification: Applications
Component: RDP (other bugs)
Version First Reported In: 25.04.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-15 17:31 UTC by Gabriel
Modified: 2025-05-16 13:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel 2025-05-15 17:31:42 UTC
SUMMARY
KRDC supports configuring a SOCKS proxy for connecting to a remote machine but it does not resolve names using the socks connection.


STEPS TO REPRODUCE
1. ssh into a remote host with -D 3129 to create a socks proxy 
2. Connect to a RDP host, on "Host Configuration" > Proxy, set Protocol to RDP and Server to localhost:3129
3. try to connect to a remote host

OBSERVED RESULT
The screen blinks and nothing happens
gdb output:
[14:24:25:680] [72281:00011a7d] [ERROR][com.freerdp.core] - [freerdp_tcp_is_hostname_resolvable]: ERRCONNECT_DNS_NAME_NOT_FOUND [0x00020005]
[14:24:25:680] [72281:00011a7d] [ERROR][com.freerdp.core.nego] - [nego_connect]: Failed to connect

EXPECTED RESULT
1. Connect to the remote host
2. An error message

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0

ADDITIONAL INFORMATION
I was having this issue to use git over a socks proxy ssh too, solved by using socks5h:// as proxy instead of socks5://
Comment 1 Fabio 2025-05-16 08:24:56 UTC
The proxy functionality in RDP connections is something provided directly by the FreeRDP library.
Looking at their code it seems they transparently pass the hostname to the remote proxy (https://github.com/FreeRDP/FreeRDP/blob/master/libfreerdp/core/transport.c#L592), so probably something else is going on here.
Can i ask you to provide a log running 

WLOG_LEVEL=DEBUG krdc

Maybe it will contain some more information about what's going on
Comment 2 Bug Janitor Service 2025-05-16 13:38:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/krdc/-/merge_requests/184
Comment 3 Fabio 2025-05-16 13:41:46 UTC
Git commit 1f5619f7c87820a7d372817900ba190bbe00d57d by Fabio Bas.
Committed on 16/05/2025 at 13:39.
Pushed by ctrlaltca into branch 'master'.

Fix parsing of user-supplied host:port preferences for proxy and gateway

M  +2    -2    rdp/rdpsession.cpp

https://invent.kde.org/network/krdc/-/commit/1f5619f7c87820a7d372817900ba190bbe00d57d
Comment 4 Fabio 2025-05-16 13:45:13 UTC
I've been able to test it locally and reproduce the problem, but it ended up being caused by another issue.
In the preferences dialog we suggest to use the "host:port" format for the proxy, while in reality we needed a full "schema://host:port" string.
This will be fixed in the next version of krdc. In the meanwhile just edit the "proxy hostname" setting adding "socks://" before the hostname and it should work fine.
Comment 5 Fabio 2025-05-16 13:50:53 UTC
Git commit 8e5167e04721863c336f59d0347af49ba9fec893 by Fabio Bas.
Committed on 16/05/2025 at 13:45.
Pushed by ctrlaltca into branch 'release/25.04'.

Fix parsing of user-supplied host:port preferences for proxy and gateway


(cherry picked from commit 1f5619f7c87820a7d372817900ba190bbe00d57d)

Co-authored-by: Fabio Bas <ctrlaltca@gmail.com>

M  +2    -2    rdp/rdpsession.cpp

https://invent.kde.org/network/krdc/-/commit/8e5167e04721863c336f59d0347af49ba9fec893