{"id":291,"date":"2015-09-25T19:29:52","date_gmt":"2015-09-25T17:29:52","guid":{"rendered":"http:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=291"},"modified":"2015-09-27T10:30:55","modified_gmt":"2015-09-27T08:30:55","slug":"eclipse-through-ntlm-proxy-using-cntlm","status":"publish","type":"post","link":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=291","title":{"rendered":"Eclipse through Ntlm proxy using cntlm"},"content":{"rendered":"<h1>Summary<\/h1>\n<p>Latest Eclipse version (LUNA, MARS) are not always able to access internet through an NTLM proxy.<\/p>\n<p>This makes updating Eclipse or installing a new feature pretty impossible.<\/p>\n<p>When the web proxy requires NTLM authentication, Eclipse fails to connect and returns a authentication<br \/>\nerror message even with various configurations:<br \/>\n&#8211; using native proxy support fails<br \/>\n&#8211; using manual settings (and providing my Windows domain, username, password) fails.<\/p>\n<p>Typical error:<\/p>\n<pre><code>Some sites could not be found.\u00a0 See the error log for more detail.\nHTTP Proxy Authentication Required:&lt;a href=\"http:\/\/download.eclipse.org\/releases\/mars\/content.xml\"&gt;http:\/\/download.eclipse.org\/releases\/mars\/content.xml&lt;\/a&gt;\nProxy Authentication Required\nHTTP Proxy Authentication Required:&lt;a href=\"http:\/\/download.eclipse.org\/eclipse\/updates\/4.5\/content.xml\"&gt;http:\/\/download.eclipse.org\/eclipse\/updates\/4.5\/content.xml&lt;\/a&gt;\nProxy Authentication Required\nHTTP Proxy Authentication Required:&lt;a href=\"http:\/\/download.eclipse.org\/webtools\/repository\/mars\/content.xml\"&gt;http:\/\/download.eclipse.org\/webtools\/repository\/mars\/content.xml&lt;\/a&gt;\nProxy Authentication Required\nHTTP Proxy Authentication Required:&lt;a href=\"http:\/\/download.eclipse.org\/mylyn\/releases\/mars\/content.xml\"&gt;http:\/\/download.eclipse.org\/mylyn\/releases\/mars\/content.xml&lt;\/a&gt;\nProxy Authentication Required\n<\/code><\/pre>\n<p>In preceding versions, I was able to make Eclipse work by using options in the &#8216;Eclipse.ini&#8217; file but this do not work anymore.<\/p>\n<p>Another workaround consist to replace the version of HTTPClient library of eclipse (either direcly by changing a jar or by installing &#8211; offline- a custom plugin that does it for us. I would not recommend this solution. It helps first later conflicts with updates or additional package.<\/p>\n<p>Bug references here:<br \/>\n&#8211; Bug ID + link<\/p>\n<h1>Using CNTML as a local proxy<\/h1>\n<p>CNTML ([<a href=\"http:\/\/cntlm.sourceforge.net\/])is\">http:\/\/cntlm.sourceforge.net\/])is<\/a>\u00a0a small local proxy, that is able to authenticate you against the Enterprise NTLM proxy once for all and forward your requests without additional authentication.<\/p>\n<p>It appears that Ecplise is ablte to traverse an NTLM proxy but not to authenticate against it.<\/p>\n<p>I deploy CNTML on a local machine, provide it with my NTLM crendentials and the target enterprise proxy.<br \/>\n&#8211; CNTML is started and listen to localhost:3128<br \/>\n&#8211; Eclipse is configured to send traffic to localhost:3128<br \/>\n&#8211; CNTML authenticate against corporateProxy:3128<br \/>\n&#8211; CNTML forwards requests to corporateProxy:3128<br \/>\n&#8211; &#8230; Eclipse gets the response.<\/p>\n<h1>CNTML setup<\/h1>\n<p>Plenty of detailled examples through the web, see [<a href=\"http:\/\/stormpoopersmith.com\/2012\/03\/20\/using-applications-behind-a-corporate-proxy\/\">http:\/\/stormpoopersmith.com\/2012\/03\/20\/using-applications-behind-a-corporate-proxy\/<\/a>] for windows.<\/p>\n<p>A summary:<\/p>\n<ul>\n<li>DL\/Install CNTML<\/li>\n<li>Update cntlm.ini (or \/etc\/cntml.conf)<br \/>\n\u00a0 * Add target proxy + port<br \/>\n\u00a0 * Restrict to localhost<br \/>\n\u00a0 * update username, domain , do not provide clear password there (exept for test)<\/p>\n<\/li>\n<li>\n<p>run <code>cntlm -c cntlm.ini -I -M\u00a0&lt;a href=\"http:\/\/google.com\/\"&gt;http:\/\/google.com&lt;\/a&gt;<\/code> to be prompted for password<\/p>\n<\/li>\n<li>cntml return hashed password, store it to cntml.ini<\/li>\n<\/ul>\n<h2>sample CNTLM sartup bat<\/h2>\n<p>Use the following bat file if cannot setup a service.<\/p>\n<pre><code class=\"BatchFile\">set cntlmexe=C:\\apps\\cntlm-0.92.3\\cntlm.exe\nset cntlmconf=C:\\apps\\cntlm-0.92.3\\cntlm.ini\n\nREM ------------- start normally and verbose\n%cntlmexe% -v -c %cntlmconf%\n\nREM ------------- start with password prompt to produce a hash\nREM %cntlmexe% -v -I -H -c %cntlmconf%\n\nREM ------------- start with password prompt to test\nREM %cntlmexe% -I -c %cntlmconf% -M&lt;a href=\"http:\/\/www.google.com\/\"&gt;http:\/\/www.google.com&lt;\/a&gt;\npause\n<\/code><\/pre>\n<h1>Configure Eclipse to use local proxy<\/h1>\n<p>Set up Eclipse to use localhost:3128 as a proxy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary Latest Eclipse version (LUNA, MARS) are not always able to access internet through an NTLM proxy. This makes updating Eclipse or installing a new feature pretty impossible. When the web proxy requires NTLM authentication, Eclipse fails to connect and returns a authentication error message even with various configurations: &#8211; using native proxy support fails &hellip; <a href=\"https:\/\/le-moulin-de-verre.com\/fieldnotes\/?p=291\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Eclipse through Ntlm proxy using cntlm&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5WcEf-4H","_links":{"self":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/291"}],"collection":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291"}],"version-history":[{"count":5,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/291\/revisions"}],"predecessor-version":[{"id":301,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=\/wp\/v2\/posts\/291\/revisions\/301"}],"wp:attachment":[{"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/le-moulin-de-verre.com\/fieldnotes\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}