You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Andreas Sahlbach (JIRA)" <ji...@apache.org> on 2010/05/27 16:32:36 UTC

[jira] Created: (HTTPCLIENT-946) Documentation Bug in SSL Guide

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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-946) Documentation Bug in SSL Guide

Posted by "Andreas Sahlbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872398#action_12872398 ] 

Andreas Sahlbach commented on HTTPCLIENT-946:
---------------------------------------------

And this assumption is based on code review or are you just guessing? I checked the code and I have a working program here, that works as I wrote but fails to work as the documentation says. 

A great number of people (including me) cannot switch to client 4.x because they have to be java 1.4 compatible. Fixing this documentation would be very easy, but who cares, eh? 

Well, I did my best. Maybe the next guy who walks into this documentation trap will read at least this report.

> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-946) Documentation Bug in SSL Guide

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873479#action_12873479 ] 

Oleg Kalnichevski commented on HTTPCLIENT-946:
----------------------------------------------

Andreas, this is not a bug, just not very good API. One must use _relative_ request URIs when executing requests using a custom HostConfiguration.

Oleg

> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-946) Documentation Bug in SSL Guide

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872922#action_12872922 ] 

Oleg Kalnichevski commented on HTTPCLIENT-946:
----------------------------------------------

> And this assumption is based on code review or are you just guessing?

I do have to make guesses once so often. In this particular case I am pretty sure as I know the intention behind the API.

'myhttps' represents a virtual scheme used internally by  Httpclient. 'https' is the 'real' protocol scheme which is used when constructing request URIs.

> A great number of people (including me) cannot switch to client 4.x because they need to have a very small dependency footprint. 

This is nonsense. 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. 

Oleg

> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-946) Documentation Bug in SSL Guide

Posted by "Andreas Sahlbach (JIRA)" <ji...@apache.org>.
    [ 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCLIENT-946) Documentation Bug in SSL Guide

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-946.
------------------------------------------

    Resolution: Won't Fix

Andreas,
I do not think the documentation is wrong. It just the API is not good. At any rate there is no point fixing non-critical bugs in the 3.x branch, as there are no releases planned for HttpClient 3.x

Oleg

> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Issue Comment Edited: (HTTPCLIENT-946) Documentation Bug in SSL Guide

Posted by "Andreas Sahlbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872398#action_12872398 ] 

Andreas Sahlbach edited comment on HTTPCLIENT-946 at 5/27/10 6:07 PM:
----------------------------------------------------------------------

And this assumption is based on code review or are you just guessing? I checked the code and I have a working program here, that works as I wrote but fails to work as the documentation says. 

A great number of people (including me) cannot switch to client 4.x because they need to have a very small dependency footprint. 

Well, I did my best. Maybe the next guy who walks into this documentation trap will read at least this report.

      was (Author: thecoolace):
    And this assumption is based on code review or are you just guessing? I checked the code and I have a working program here, that works as I wrote but fails to work as the documentation says. 

A great number of people (including me) cannot switch to client 4.x because they have to be java 1.4 compatible. Fixing this documentation would be very easy, but who cares, eh? 

Well, I did my best. Maybe the next guy who walks into this documentation trap will read at least this report.
  
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org