Skip to content
Permalink
Browse files
[JENKINS-27260] SPNEGO for Windows in EC2 Plugin
Fixed the Windows temp directory getting set to ""
Enabled SPNEGO authentication

JENKINS-25385 and JENKINS-4995 both have comments complaining about
infinite loops when creating Windows slaves. Because SPNEGO is
unregistered for, the httpclient throws and exception that is silently
caught and causes the infinite loop.
  • Loading branch information
Jason Mittertreiner committed Mar 6, 2015
1 parent ba77bb7 commit 0e840f7129b91af5101cb8f08f938743dc188ff9
Showing 2 changed files with 2 additions and 2 deletions.
@@ -30,7 +30,7 @@ protected void launch(EC2Computer computer, PrintStream logger, Instance inst) t

try {
String initScript = computer.getNode().initScript;
String tmpDir = (computer.getNode().tmpDir != null ? computer.getNode().tmpDir : "C:\\Windows\\Temp\\");
String tmpDir = (computer.getNode().tmpDir != null && !computer.getNode().tmpDir.equals("") ? computer.getNode().tmpDir : "C:\\Windows\\Temp\\");

logger.println("Creating tmp directory if it does not exist");
connection.execute("if not exist " + tmpDir + " mkdir " + tmpDir);
@@ -200,7 +200,7 @@ private void setupHTTPClient() {
private DefaultHttpClient buildHTTPClient()
{
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getAuthSchemes().unregister(AuthPolicy.SPNEGO);
//httpclient.getAuthSchemes().unregister(AuthPolicy.SPNEGO);
httpclient.setCredentialsProvider(credsProvider);
httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 5000);
//httpclient.setHttpRequestRetryHandler(new WinRMRetryHandler());

0 comments on commit 0e840f7

Please sign in to comment.