[
https://issues.apache.org/jira/browse/HTTPCLIENT-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873011#action_12873011
]
Andreas Sahlbach commented on HTTPCLIENT-946:
---------------------------------------------
Ok, then I agree with you that it is indeed a bug. The problem is, that
HttpMethodBase.getURI() actually recreates the URI from the data of the
Protocol (which essentially replaces the virtual scheme with the real scheme).
And later HostConfiguration gathers the Protocol with this newly created URI,
fetching the standart SocketFactory instead of your customized SocketFactory.
So the customized SocketFactory is actually never used.
Still funny that it works when I use it the way I described.
> HttpClient 4.0 and HttpClient 3.1 share the same set of dependencies:
> commons-logging and commons-codec. The only difference is that in the 4.x
> branch core components are packaged as a separately versioned module called
> HttpCore. One of the reasons why it was done that way is dependency
> management. Those users who need only basic HTTP transport can use HttpCore
> without any extra dependencies.
Great! I didn't know this. I just saw a lot of dependencies in the lib folder
without seeing that most of them are optional or just splits of the same code.
I will give it a try then, thanks!
> Documentation Bug in SSL Guide
> ------------------------------
>
> Key: HTTPCLIENT-946
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-946
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 3.1 Final
> Reporter: Andreas Sahlbach
>
> In the SSL Guide for commons-httpclient-3.x you can find the following
> section:
> -----
> {noformat}
> Finally, you can register your custom protocol as the default handler for a
> specific protocol designator (eg: https) by calling the
> Protocol.registerProtocol method. You can specify your own protocol
> designator (such as 'myhttps') if you need to use your custom protocol as
> well as the default SSL protocol implementation.
> {noformat}
> {code:java}
> Protocol.registerProtocol("myhttps",
> new Protocol("https", new MySSLSocketFactory(), 9443));
> {code}
> -----
> IMHO the first Parameter in the Protocol constructor must be "myhttps", too.
> At least here only in this case the new Protocol is found and the
> MySSLSocketFactory is actually used. The original code only seems to work,
> because the register call doesn't fail, but the normal SSL Protocol object is
> actually used.
> PS: hope this confluence format stuff actually works.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]