Skip to content

Commit

Permalink
Remove always null call for Certificate Credentials
Browse files Browse the repository at this point in the history
Explicitly setting this to null for clarity. This also reduces the
parameters needed to construct a client.
  • Loading branch information
sghill committed Oct 21, 2021
1 parent df02f57 commit 8d9dafa
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ protected Collection<String> lookupCommitSha1s(
protected CloseableHttpClient getHttpClient(PrintStream logger, Run<?, ?> run, String stashServer) throws Exception {
DescriptorImpl globalSettings = getDescriptor();

CertificateCredentials certificateCredentials = getCredentials(CertificateCredentials.class, run.getParent());

final int timeoutInMilliseconds = 60_000;

RequestConfig.Builder requestBuilder = RequestConfig.custom()
Expand All @@ -477,7 +475,7 @@ protected CloseableHttpClient getHttpClient(PrintStream logger, Run<?, ?> run, S
if (url.getProtocol().equals("https") && ignoreUnverifiedSSL) {
// add unsafe trust manager to avoid thrown SSLPeerUnverifiedException
try {
SSLContext sslContext = buildSslContext(ignoreUnverifiedSSL, certificateCredentials);
SSLContext sslContext = buildSslContext(ignoreUnverifiedSSL, null);
SSLConnectionSocketFactory sslConnSocketFactory = new SSLConnectionSocketFactory(
sslContext,
new String[]{"TLSv1", "TLSv1.1", "TLSv1.2"},
Expand Down

0 comments on commit 8d9dafa

Please sign in to comment.