Skip to content

Commit

Permalink
[JENKINS-27260] SPNEGO for Windows in EC2 Plugin
Browse files Browse the repository at this point in the history
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 0e840f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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);
Expand Down
Expand Up @@ -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());
Expand Down

0 comments on commit 0e840f7

Please sign in to comment.