Friday, September 29, 2017

CNTLM - Proxy Configuration

Proxy Server and Configuration:
Initially there were only Sever and Client. When client wants a resource from Sever, it sends a request using a protocol. eg: Browser sending a request for google.com home page from GOOGLE server using HTTP protocol.

But in a corporate environment, there exists a proxy server which is a middleman between application-clients and the websites 
1. To impose restrictions on web-browsing
2. To hide identity of the users/client-machine information

How Proxy sever works:
In a proxy environment scenario, 
1. An application such as a browser sends a request to Proxy server. Means, when you type a URL and click send, the HttpRequest for the actual server will be fwded to Proxy server by browser.
2. Proxy server verifies the request then forwards it to the website. It then receives the response and verifies the same. Finally the proxy server sends the response to Application that requested.

A proxy server needs authentication information from the applications that it needs to server. This information is configured in the applications(clients) via Proxy-Settings where the following details are provided..
Proxy Server name, Proxy port, Username and Password

Once the proxy settings are configured, the application sends request to the appropriate proxy server. This is called basic authentication.

Proxy server that needs NTLM:
Many applications now-a-days comes with an inbuilt feature where the proxy information can be provided/configured apart from being able to send a request to actual server. But sometimes, a proxy server needs NTLM authentication besides basic.
And some applications are not equipped to send NTLM authentication (just like they send basic authentication). In such cases we need another software that knows how to send NTLM information to the Proxy.

Cntlm is a software that stands between application-clients and Proxies. CNTLM acts like a local proxy server which is configured with authentication information. All applications now can be configured to send requests to CNTLM server that is running at a configured host and port usually at Localhost+3128.
Cntlm then sends that request to actual proxy server and receives the response from Proxy.

Future directions for applications to have:
1. Able to send http requests
2. Able to setup proxy to fwd http requests to Proxy server
3. Able to send NTLM data to NTLM server


No comments:

How J2EE components work together in any Container - Spring or Application Server

In a Spring+Jersey+Hibernate RESTful webapplication, we can spot various J2EE components - JTA, JPA, Java Bean Validation, JSON-B API for B...