List of usage examples for org.apache.commons.httpclient.contrib.ssl EasySSLProtocolSocketFactory EasySSLProtocolSocketFactory
public EasySSLProtocolSocketFactory()
From source file:org.wso2.mdm.integration.common.MDMHttpClient.java
public MDMResponse delete(String endpoint) { HttpClient client = new HttpClient(); try {// ww w .j a v a 2 s .co m ProtocolSocketFactory socketFactory = new EasySSLProtocolSocketFactory(); Protocol https = new Protocol("https", socketFactory, 9443); Protocol.registerProtocol("https", https); String url = backEndUrl + endpoint; DeleteMethod method = new DeleteMethod(url); method.setRequestHeader(AUTHORIZATION, authrizationString); method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(3, false)); MDMResponse mdmResponse = new MDMResponse(); mdmResponse.setStatus(client.executeMethod(method)); mdmResponse.setBody(method.getResponseBodyAsString()); return mdmResponse; } catch (GeneralSecurityException e) { log.error("Failure occurred at MDMResponse delete for GeneralSecurityException", e); } catch (IOException e) { log.error("Failure occurred at MDMResponse delete for IOException", e); } return null; }