Commit 8336695f authored by Greg Messner's avatar Greg Messner
Browse files

Cleaned up setIgnoreCerificateErrors().

parent b1a89968
...@@ -122,19 +122,21 @@ public class GitLabApiClient { ...@@ -122,19 +122,21 @@ public class GitLabApiClient {
return; return;
} }
if (ignoreCertificateErrors == false) { if (!ignoreCertificateErrors) {
GitLabApiClient.ignoreCertificateErrors = false; GitLabApiClient.ignoreCertificateErrors = false;
HttpsURLConnection.setDefaultSSLSocketFactory(GitLabApiClient.defaultSocketFactory); HttpsURLConnection.setDefaultSSLSocketFactory(GitLabApiClient.defaultSocketFactory);
return;
} } else {
SSLSocketFactory defaultSocketFactory = HttpsURLConnection.getDefaultSSLSocketFactory(); SSLSocketFactory defaultSocketFactory = HttpsURLConnection.getDefaultSSLSocketFactory();
if (ignoreCertificateErrors() == true) { if (ignoreCertificateErrors()) {
GitLabApiClient.ignoreCertificateErrors = true; GitLabApiClient.ignoreCertificateErrors = true;
GitLabApiClient.defaultSocketFactory = defaultSocketFactory; GitLabApiClient.defaultSocketFactory = defaultSocketFactory;
} else { } else {
throw new RuntimeException("Unable to ignore certificate errors."); throw new RuntimeException("Unable to ignore certificate errors.");
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment