[AMQ-7476] Add http schema in the HTTP registry

This commit is contained in:
jbonofre 2020-05-05 07:33:34 +02:00
parent aa03f295f5
commit 910a028fa7
1 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@ import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.HttpClientConnectionManager;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.DefaultHostnameVerifier;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
@ -61,6 +62,7 @@ public class HttpsClientTransport extends HttpClientTransport {
HostnameVerifier hostnameVerifier = verifyHostName ? new DefaultHostnameVerifier() : new NoopHostnameVerifier();
SSLConnectionSocketFactory sslConnectionFactory = new SSLConnectionSocketFactory(sslSocketFactory, hostnameVerifier);
registryBuilder.register("https", sslConnectionFactory);
registryBuilder.register("http", PlainConnectionSocketFactory.INSTANCE);
return registryBuilder.build();
} catch (Exception e) {
throw new IllegalStateException("Failure trying to create scheme registry", e);