You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Alibek Jorajev (Created) (JIRA)" <ji...@apache.org> on 2012/02/28 19:31:46 UTC
[jira] [Created] (HTTPCLIENT-1169) DefaultClientConnectionOperator
- ability to set socket factory
DefaultClientConnectionOperator - ability to set socket factory
---------------------------------------------------------------
Key: HTTPCLIENT-1169
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1169
Project: HttpComponents HttpClient
Issue Type: Wish
Components: HttpClient
Environment: Android, api level 12.
Reporter: Alibek Jorajev
Priority: Minor
DefaultClientConnectionOperator internally uses plain socket factory:
private static final PlainSocketFactory staticPlainSocketFactory = new PlainSocketFactory();
I could override DefaultHttpClient, createClientConnectionManager() method and for HTTP scheme I can register my own socket factory. But for HTTPS, I would like to keep org.apache.http.conn.ssl.SSLSocketFactory. but in the DefaultClientConnectionOperator.openConnection(), I would like still to supply my own plain socket which goes underneath of layered socket:
public void openConnection(OperatedClientConnection conn,
HttpHost target,
InetAddress local,
HttpContext context,
HttpParams params)
throws IOException {
.....
final Scheme schm = schemeRegistry.getScheme(target.getSchemeName());
final SocketFactory sf = schm.getSocketFactory();
final SocketFactory plain_sf;
final LayeredSocketFactory layered_sf;
if (sf instanceof LayeredSocketFactory) {
plain_sf = staticPlainSocketFactory; <= ======== I would like to replace this with my own factory. it is hard coded now.
layered_sf = (LayeredSocketFactory)sf;
} else {
plain_sf = sf;
layered_sf = null;
}
. . . . .. . .
} // openConnection
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] [Commented] (HTTPCLIENT-1169)
DefaultClientConnectionOperator - ability to set socket factory
Posted by "Alibek Jorajev (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13218965#comment-13218965 ]
Alibek Jorajev commented on HTTPCLIENT-1169:
--------------------------------------------
Hello Oleg,
ok, I understand now. thanks for your time to reply.
regards,
Alibek
On Tue, Feb 28, 2012 at 7:29 PM, Oleg Kalnichevski (Resolved) (JIRA)
> DefaultClientConnectionOperator - ability to set socket factory
> ---------------------------------------------------------------
>
> Key: HTTPCLIENT-1169
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1169
> Project: HttpComponents HttpClient
> Issue Type: Wish
> Components: HttpClient
> Environment: Android, api level 12.
> Reporter: Alibek Jorajev
> Priority: Minor
>
> DefaultClientConnectionOperator internally uses plain socket factory:
> private static final PlainSocketFactory staticPlainSocketFactory = new PlainSocketFactory();
> I could override DefaultHttpClient, createClientConnectionManager() method and for HTTP scheme I can register my own socket factory. But for HTTPS, I would like to keep org.apache.http.conn.ssl.SSLSocketFactory. but in the DefaultClientConnectionOperator.openConnection(), I would like still to supply my own plain socket which goes underneath of layered socket:
> public void openConnection(OperatedClientConnection conn,
> HttpHost target,
> InetAddress local,
> HttpContext context,
> HttpParams params)
> throws IOException {
> .....
> final Scheme schm = schemeRegistry.getScheme(target.getSchemeName());
> final SocketFactory sf = schm.getSocketFactory();
> final SocketFactory plain_sf;
> final LayeredSocketFactory layered_sf;
> if (sf instanceof LayeredSocketFactory) {
> plain_sf = staticPlainSocketFactory; <= ======== I would like to replace this with my own factory. it is hard coded now.
> layered_sf = (LayeredSocketFactory)sf;
> } else {
> plain_sf = sf;
> layered_sf = null;
> }
>
> . . . . .. . .
> } // openConnection
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] [Resolved] (HTTPCLIENT-1169) DefaultClientConnectionOperator
- ability to set socket factory
Posted by "Oleg Kalnichevski (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski resolved HTTPCLIENT-1169.
-------------------------------------------
Resolution: Not A Problem
Alibek
HttpClient code maintained by Google has diverted too much and is now effectively a fork. The DefaultClientConnectionOperator in the stock version of HttpClient does not make use of the PlainSocketFactory [1]
You could try raising this issue with Google but as far as I know they are not really interested in maintaining their own fork of HttpClient.
Oleg
[1] http://hc.apache.org/httpcomponents-client-dev/httpclient/xref/org/apache/http/impl/conn/DefaultClientConnectionOperator.html#140
> DefaultClientConnectionOperator - ability to set socket factory
> ---------------------------------------------------------------
>
> Key: HTTPCLIENT-1169
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1169
> Project: HttpComponents HttpClient
> Issue Type: Wish
> Components: HttpClient
> Environment: Android, api level 12.
> Reporter: Alibek Jorajev
> Priority: Minor
>
> DefaultClientConnectionOperator internally uses plain socket factory:
> private static final PlainSocketFactory staticPlainSocketFactory = new PlainSocketFactory();
> I could override DefaultHttpClient, createClientConnectionManager() method and for HTTP scheme I can register my own socket factory. But for HTTPS, I would like to keep org.apache.http.conn.ssl.SSLSocketFactory. but in the DefaultClientConnectionOperator.openConnection(), I would like still to supply my own plain socket which goes underneath of layered socket:
> public void openConnection(OperatedClientConnection conn,
> HttpHost target,
> InetAddress local,
> HttpContext context,
> HttpParams params)
> throws IOException {
> .....
> final Scheme schm = schemeRegistry.getScheme(target.getSchemeName());
> final SocketFactory sf = schm.getSocketFactory();
> final SocketFactory plain_sf;
> final LayeredSocketFactory layered_sf;
> if (sf instanceof LayeredSocketFactory) {
> plain_sf = staticPlainSocketFactory; <= ======== I would like to replace this with my own factory. it is hard coded now.
> layered_sf = (LayeredSocketFactory)sf;
> } else {
> plain_sf = sf;
> layered_sf = null;
> }
>
> . . . . .. . .
> } // openConnection
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org