Skip to content

Commit

Permalink
Merge pull request #630 from jenkinsci/bugfix/smbj-workaround
Browse files Browse the repository at this point in the history
Set SecurityProvider for SMB
  • Loading branch information
res0nance committed Jun 10, 2021
2 parents da3de35 + 7614408 commit ed30745
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/hudson/plugins/ec2/win/WinConnection.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package hudson.plugins.ec2.win;

import com.hierynomus.security.bc.BCSecurityProvider;
import com.hierynomus.smbj.SmbConfig;
import hudson.plugins.ec2.win.winrm.WinRM;
import hudson.plugins.ec2.win.winrm.WindowsProcess;

Expand Down Expand Up @@ -46,7 +48,9 @@ public WinConnection(String host, String username, String password, boolean allo
this.host = host;
this.username = username;
this.password = password;
this.smbclient = new SMBClient();
// TODO: Remove once https://github.com/hierynomus/smbj/issues/638 is in the release
SmbConfig config = SmbConfig.builder().withSecurityProvider(new BCSecurityProvider()).build();
this.smbclient = new SMBClient(config);
this.authentication = new AuthenticationContext(username, password.toCharArray(), null);
this.allowSelfSignedCertificate = allowSelfSignedCertificate;
}
Expand Down

0 comments on commit ed30745

Please sign in to comment.