Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RESTEASY-1200][RESTEASY-975][RESTEASY-1463] Automatically discover A… #895

Merged
merged 1 commit into from
Aug 31, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ public static enum HostnameVerificationPolicy
}

private static final boolean useOldHTTPClient = Boolean.getBoolean("org.jboss.resteasy.client.useOldHTTPClient");
private static final boolean newHTTPClientAvailable;
static {
boolean res = true;
try {
Class.forName(HttpClientBuilder43.class.getName());
} catch (Throwable t) {
res = false;
}
newHTTPClientAvailable = res;
}
protected KeyStore truststore;
protected KeyStore clientKeyStore;
protected String clientPrivateKeyPassword;
Expand Down Expand Up @@ -390,7 +400,7 @@ public ResteasyClient buildOld()
@Override
public ResteasyClient build()
{
if (useOldHTTPClient) {
if (useOldHTTPClient || !newHTTPClientAvailable) {
return buildOld();
}
ClientConfiguration config = new ClientConfiguration(getProviderFactory());
Expand Down