RTC Forums

Subscription => Support => Topic started by: Nanosystems on September 23, 2016, 02:09:59 PM



Title: TRtcHttpClient and Proxy with NTLM authentication
Post by: Nanosystems on September 23, 2016, 02:09:59 PM
I'm trying to use the TRtcHttpClient component with Squid Proxy - NTLM Authentication.
If I check only the "UseProxy" property everything works fine (I suppose that it takes the proxy settings from IE and credentials from windows login), but if I specify manually the proxy address, the port, the username and the password it doesn't work.
I need to run the application as a windows service (SYSTEM user), so I need to specify the proxy settings manually.

Is it possible to do that with RealThinClient? If I use a simple TIdHTTP Indy component, I'm able to authenticate through NTML Proxy even from a windows service (SYSTEM user)
Where am I wrong?


Title: Re: TRtcHttpClient and Proxy with NTLM authentication
Post by: D.Tkalcec (RTC) on September 23, 2016, 02:44:27 PM
WinInet API gets its settings from Internet Explorer, for which the user has to be logged in, making it unsuitable for Windows Services. Use the WinHTTP API for Windows Services by setting "useWinHTTP:=TRUE".

WinHTTP API can either be configured with the "UserLogin" property (TRtcHttpClient component),
or directly from Windows by using "netsh" in Windows Console (Google "WinHTTP configuration"):
http://superuser.com/questions/489527/how-can-i-configure-proxy-settings-for-all-apps-system-ie-etc

----
Here is a copy/paste from the link above (in case the page should dissapear later) ...

To configure a system wide proxy do (from a Windows Command Prompt -> CMD)
  netsh winhttp set proxy myproxy

Source: http://technet.microsoft.com/pt-br/library/cc731131(v=ws.10).aspx#BKMK_5

if you want to use IE proxy settings for all programs, try
  netsh winhttp import proxy source=ie

Source: http://technet.microsoft.com/pt-br/library/cc731131(v=ws.10).aspx#BKMK_2

For more information, check:
  https://msdn.microsoft.com/en-us/library/windows/desktop/aa384069(v=vs.85).aspx

Best Regards,
Danijel Tkalcec