Skip to content

Commit

Permalink
switch to the exepcted SecretTextArea
Browse files Browse the repository at this point in the history
Now that formvalidation has been manually tested swap back to
SecretTextArea

The formValidation won't work pending JENKINS-73404 (and to some extent
JENKINS-65616) but once they are fixed will magically start working
  • Loading branch information
jtnord committed Jul 5, 2024
1 parent 44569cb commit a6e3457
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ public CertificateCredentialsImpl(@CheckForNull CredentialsScope scope,
Objects.requireNonNull(keyStoreSource);
this.password = Secret.fromString(password);
this.keyStoreSource = keyStoreSource;
// ensure the keySore is valid
// we check here as otherwise it will lead to hard to diagnose errors when used
try {
keyStoreSource.toKeyStore(toCharArray(this.password));
} catch (GeneralSecurityException | IOException e) {
throw new IllegalArgumentException("KeyStore is not valid.", e);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:entry title="Certificates" field="certChain">
<f:textarea />
<f:secretTextarea />
</f:entry>
<f:entry title="Private key" field="privateKey">
<f:textarea />
<f:secretTextarea />
</f:entry>
</j:jelly>

0 comments on commit a6e3457

Please sign in to comment.