You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by geecxf <am...@ge.com> on 2013/02/02 04:54:36 UTC
Bug in 2.7.2
I found a bug in the 2.7.2 code and would like to know how to submit it. The
bug is so obvious you don't even need code to reproduce it to realize it is
a bug. Observe the following code from JettHTTPServerEngine.java especially
line 3:
protected void retrieveListenerFactory() {
if (tlsServerParameters != null) {
if (null != connector && !(connector instanceof
SslSocketConnector)) {
LOG.warning("Connector " + connector + " for
JettyServerEngine Port "
+ port + " does not support SSL connections.");
return;
}
connectorFactory =
getHTTPSConnectorFactory(tlsServerParameters);
protocol = "https";
} else {
if (connector instanceof SslSocketConnector) {
throw new RuntimeException("Connector " + connector + " for
JettyServerEngine Port "
+ port + " does not support non-SSL connections.");
}
connectorFactory = getHTTPConnectorFactory();
protocol = "http";
}
LOG.fine("Configured port " + port + " for \"" + protocol + "\".");
}
Now ask yourself: what were to happen if I were using
SslSelectChannelConnector instead of SslSocketConnector? I can work around
this problem if I use code to create my engine and was thus able to verify
that SslSelectChannelConnector works fine. However, if I use Spring to
create my engine I'm out of luck... I have to use SslSocketConnector or it
fails. Another way I verified that SslSelectChannel connector works fine is
by breaking in the code during instantiation by Spring and forcing the
protocol to "https" which results in a perfectly responsive HTTPS port even
though the code logic does not allow it.
I'm perfectly happy to create an but item for this if someone gives me
access to do so (or at least explains what to do). I'm even happy to make
the change myself is someone also spends just a little bit of time giving me
some guidance on how to do so.
Thanks,
D
--
View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Bug in 2.7.2
Posted by geecxf <am...@ge.com>.
BTW I noticed that you are with Talend and I believe my company has a support
contract with you. If this will help motivate a fix please let me know.
--
View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722735.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Bug in 2.7.2
Posted by "Amiri, Dario (GE Global Research)" <am...@ge.com>.
Hi Dan,
Thanks for the super quick fix! I hope to verify this as soon as possible
but organizational bureaucracy may prevent me from getting to it for a few
days or more. As soon as I get to it I will be sure to post the results.
Thanks,
Dario Amiri
Lead Software Engineer
GE Global Research
T +1 925 242 6200
amiri@ge.com
2623 Camino Ramon, Suite 500
San Ramon, 94583 United States
GE imagination at work
On 2/5/13 12:24 PM, "Daniel Kulp" <dk...@apache.org> wrote:
>
>Discovered that both SslSocketConnector and SslSelectChannelConnector
>both implement a common SslConnector interface. Thus, I was able to
>change the instanceof to that which should cover the use case. Any
>chance you could verify? New snapshots should deploy tonight.
>
>Dan
>
>
>
>On Feb 4, 2013, at 2:29 PM, geecxf <am...@ge.com> wrote:
>
>> Here is the link to the JIRA issue:
>>
>> https://issues.apache.org/jira/browse/CXF-4806
>> <https://issues.apache.org/jira/browse/CXF-4806>
>>
>> Thanks,
>>
>> D
>>
>>
>>
>> --
>> View this message in context:
>>http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722739.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
>--
>Daniel Kulp
>dkulp@apache.org - http://dankulp.com/blog
>Talend Community Coder - http://coders.talend.com
>
Re: Bug in 2.7.2
Posted by Daniel Kulp <dk...@apache.org>.
Discovered that both SslSocketConnector and SslSelectChannelConnector both implement a common SslConnector interface. Thus, I was able to change the instanceof to that which should cover the use case. Any chance you could verify? New snapshots should deploy tonight.
Dan
On Feb 4, 2013, at 2:29 PM, geecxf <am...@ge.com> wrote:
> Here is the link to the JIRA issue:
>
> https://issues.apache.org/jira/browse/CXF-4806
> <https://issues.apache.org/jira/browse/CXF-4806>
>
> Thanks,
>
> D
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722739.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Bug in 2.7.2
Posted by geecxf <am...@ge.com>.
Here is the link to the JIRA issue:
https://issues.apache.org/jira/browse/CXF-4806
<https://issues.apache.org/jira/browse/CXF-4806>
Thanks,
D
--
View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722739.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Bug in 2.7.2
Posted by Benson Margulies <bi...@gmail.com>.
If you have a contract with Talend, please use the appropriate channel
to communicate with them about that.
On Mon, Feb 4, 2013 at 2:04 PM, geecxf <am...@ge.com> wrote:
> I'd love to help out. However, I've never patched open source before. If you
> can point me to a how-to for the process please do.
>
> In the meanwhile I'll log the issue in JIRA.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722736.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Re: Bug in 2.7.2
Posted by geecxf <am...@ge.com>.
I'd love to help out. However, I've never patched open source before. If you
can point me to a how-to for the process please do.
In the meanwhile I'll log the issue in JIRA.
--
View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722736.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Bug in 2.7.2
Posted by Daniel Kulp <dk...@apache.org>.
Yea, this is definitely a bug. If you could log a an issue at:
https://issues.apache.org/jira/browse/CXF
that would be great. A patch would be awesome. :-)
Dan
On Feb 4, 2013, at 1:55 PM, geecxf <am...@ge.com> wrote:
> Thank you for the prompt response. With all due respect, I would disagree.
> And the proof is in 2 places:
>
> 1. By default the code creates a JettySslFactoryConnector. Calling
> createConnector() on the factory returns an instance of
> CXFJettySslSocketConnector which extends SslSelectChannelConnector. This is
> great but there is no way for me to configure the number of acceptors on
> that channel. Maybe that is an enhancement request. Either way clearly there
> was intent to support this.
>
> 2. Look at the else statement of that method which is called when you
> specify a connector for a plain HTTP engine. The error checking in the code
> has a big problem: it only throws an error if the connector is of type
> SslSocketConnector (since it is plain HTTP not HTTPS you can't use that
> connector). That means that I could specify a connector of type
> SslSelectChannelConnector for a plain HTTP engine and it would not report
> that as a problem. That's obviously not right.
>
> In my humble opinion, what the code should do is check that the set
> connector implements the SslConnector interface. Both SslSocketConnector and
> SslSelectChannelConnector implement the SslConnector interface. This would
> result in correct behavior when setting an SSL connector and correct error
> checking when not. My guess is that this was probably a typo.
>
> It's a simple change and I would even be happy to make it. Once again I just
> need a little hand holding to do it.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722733.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Bug in 2.7.2
Posted by geecxf <am...@ge.com>.
Thank you for the prompt response. With all due respect, I would disagree.
And the proof is in 2 places:
1. By default the code creates a JettySslFactoryConnector. Calling
createConnector() on the factory returns an instance of
CXFJettySslSocketConnector which extends SslSelectChannelConnector. This is
great but there is no way for me to configure the number of acceptors on
that channel. Maybe that is an enhancement request. Either way clearly there
was intent to support this.
2. Look at the else statement of that method which is called when you
specify a connector for a plain HTTP engine. The error checking in the code
has a big problem: it only throws an error if the connector is of type
SslSocketConnector (since it is plain HTTP not HTTPS you can't use that
connector). That means that I could specify a connector of type
SslSelectChannelConnector for a plain HTTP engine and it would not report
that as a problem. That's obviously not right.
In my humble opinion, what the code should do is check that the set
connector implements the SslConnector interface. Both SslSocketConnector and
SslSelectChannelConnector implement the SslConnector interface. This would
result in correct behavior when setting an SSL connector and correct error
checking when not. My guess is that this was probably a typo.
It's a simple change and I would even be happy to make it. Once again I just
need a little hand holding to do it.
--
View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635p5722733.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Bug in 2.7.2
Posted by Glen Mazza <gm...@talend.com>.
I'm not sure we need to support SslSelectChannelConnector (however nice
it might be if we did); CXF's embedded Jetty usage is AFAICT just to
implement the Endpoint.publish() requirements of the JAX-WS
specification; CXF just happens to use Jetty for this but we can use
several other tools internally as well if we wished (for example,
Grizzly.) So long as we're satisfying HTTP and SSL transports (which we
apparently are with the options provided), we're done. I would say what
you're requesting is more of an enhancement request than a bug.
Glen
On 02/01/2013 10:54 PM, geecxf wrote:
> I found a bug in the 2.7.2 code and would like to know how to submit it. The
> bug is so obvious you don't even need code to reproduce it to realize it is
> a bug. Observe the following code from JettHTTPServerEngine.java especially
> line 3:
>
> protected void retrieveListenerFactory() {
> if (tlsServerParameters != null) {
> if (null != connector && !(connector instanceof
> SslSocketConnector)) {
> LOG.warning("Connector " + connector + " for
> JettyServerEngine Port "
> + port + " does not support SSL connections.");
> return;
> }
> connectorFactory =
> getHTTPSConnectorFactory(tlsServerParameters);
> protocol = "https";
>
> } else {
> if (connector instanceof SslSocketConnector) {
> throw new RuntimeException("Connector " + connector + " for
> JettyServerEngine Port "
> + port + " does not support non-SSL connections.");
> }
> connectorFactory = getHTTPConnectorFactory();
> protocol = "http";
> }
> LOG.fine("Configured port " + port + " for \"" + protocol + "\".");
> }
>
> Now ask yourself: what were to happen if I were using
> SslSelectChannelConnector instead of SslSocketConnector? I can work around
> this problem if I use code to create my engine and was thus able to verify
> that SslSelectChannelConnector works fine. However, if I use Spring to
> create my engine I'm out of luck... I have to use SslSocketConnector or it
> fails. Another way I verified that SslSelectChannel connector works fine is
> by breaking in the code during instantiation by Spring and forcing the
> protocol to "https" which results in a perfectly responsive HTTPS port even
> though the code logic does not allow it.
>
> I'm perfectly happy to create an but item for this if someone gives me
> access to do so (or at least explains what to do). I'm even happy to make
> the change myself is someone also spends just a little bit of time giving me
> some guidance on how to do so.
>
> Thanks,
>
> D
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-tp5722635.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza