Coverage Report - org.mule.transport.http.HttpsClientMessageDispatcher
 
Classes in this File Line Coverage Branch Coverage Complexity
HttpsClientMessageDispatcher
0%
0/11
N/A
0
 
 1  
 /*
 2  
  * $Id: HttpsClientMessageDispatcher.java 19191 2010-08-25 21:05:23Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.transport.http;
 12  
 
 13  
 import org.mule.api.endpoint.OutboundEndpoint;
 14  
 
 15  
 import java.net.URI;
 16  
 
 17  
 import javax.net.ssl.SSLSocketFactory;
 18  
 
 19  
 import org.apache.commons.httpclient.HostConfiguration;
 20  
 import org.apache.commons.httpclient.protocol.Protocol;
 21  
 import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
 22  
 
 23  
 public class HttpsClientMessageDispatcher extends HttpClientMessageDispatcher
 24  
 {
 25  
     
 26  
     public HttpsClientMessageDispatcher(OutboundEndpoint endpoint)
 27  
     {
 28  0
         super(endpoint);
 29  0
     }
 30  
 
 31  
     @Override
 32  
     protected HostConfiguration getHostConfig(URI uri) throws Exception
 33  
     {        
 34  0
         HostConfiguration hostConfig = new MuleHostConfiguration(super.getHostConfig(uri));
 35  
 
 36  0
         HttpsConnector httpsConnector = (HttpsConnector) connector;
 37  0
         SSLSocketFactory factory = httpsConnector.getSslSocketFactory();
 38  0
         ProtocolSocketFactory protocolSocketFactory = new MuleSecureProtocolSocketFactory(factory);
 39  0
         Protocol protocol = new Protocol(uri.getScheme().toLowerCase(), protocolSocketFactory, 443);
 40  
         
 41  0
         String host = uri.getHost();
 42  0
         int port = uri.getPort();
 43  0
         hostConfig.setHost(host, port, protocol);            
 44  
         
 45  0
         return hostConfig;
 46  
     }
 47  
 
 48  
 }
 49  
 
 50