1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
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 | |
|