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

Cleaned up setIgnoreCerificateErrors().

parent b1a89968
......@@ -122,19 +122,21 @@ public class GitLabApiClient {
return;
}
if (ignoreCertificateErrors == false) {
if (!ignoreCertificateErrors) {
GitLabApiClient.ignoreCertificateErrors = false;
HttpsURLConnection.setDefaultSSLSocketFactory(GitLabApiClient.defaultSocketFactory);
return;
}
} else {
SSLSocketFactory defaultSocketFactory = HttpsURLConnection.getDefaultSSLSocketFactory();
SSLSocketFactory defaultSocketFactory = HttpsURLConnection.getDefaultSSLSocketFactory();
if (ignoreCertificateErrors() == true) {
GitLabApiClient.ignoreCertificateErrors = true;
GitLabApiClient.defaultSocketFactory = defaultSocketFactory;
} else {
throw new RuntimeException("Unable to ignore certificate errors.");
if (ignoreCertificateErrors()) {
GitLabApiClient.ignoreCertificateErrors = true;
GitLabApiClient.defaultSocketFactory = defaultSocketFactory;
} else {
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