Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-31192] Fix HTTPS SSL client certificate authentication
Take benefits of new SVNKit 1.8.11 SVNSSLAuthentication methods to properly
support byte array PKCS#12 certificate usage.

Resolves: JENKINS-31192
  • Loading branch information
ymartin59 committed Nov 6, 2015
1 parent d57da37 commit 86e18b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Expand Up @@ -454,9 +454,10 @@ public SVNCertificateAuthenticationBuilder(CertificateCredentials c) {

public List<SVNAuthentication> build(String kind, SVNURL url) {
if (ISVNAuthenticationManager.SSL.equals(kind)) {
SVNSSLAuthentication authentication =
new SVNSSLAuthentication(String.valueOf(certificateFile), Scrambler.descramble(password), false, url, false);
authentication.setCertificatePath("dummy"); // TODO: remove this JENKINS-19175 workaround
SVNSSLAuthentication authentication = SVNSSLAuthentication.newInstance(
certificateFile,
Scrambler.descramble(password).toCharArray(),
false, url, false);
return Collections.<SVNAuthentication>singletonList(
authentication);
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/hudson/scm/SubversionSCM.java
Expand Up @@ -1993,10 +1993,10 @@ public SslClientCertificateCredential(File certificate, String password) throws
public SVNAuthentication createSVNAuthentication(String kind) {
if(kind.equals(ISVNAuthenticationManager.SSL))
try {
SVNSSLAuthentication authentication = new SVNSSLAuthentication(
String.valueOf(Base64.decode(certificate.getPlainText().toCharArray())),
Scrambler.descramble(Secret.toString(password)), false, null, false);
authentication.setCertificatePath("dummy"); // TODO: remove this JENKINS-19175 workaround
SVNSSLAuthentication authentication = SVNSSLAuthentication.newInstance(
Base64.decode(certificate.getPlainText().toCharArray()),
Scrambler.descramble(Secret.toString(password)).toCharArray(),
false, null, false);
return authentication;
} catch (IOException e) {
throw new Error(e); // can't happen
Expand Down

0 comments on commit 86e18b3

Please sign in to comment.