jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Jetty
  • JETTY-553

SSL information is not passed to the request in the SslSelectChannelConnector

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 7.0.0pre0
  • Component/s: None
  • Labels:
    None
  • Environment:
    Using the latest version from subversion.
  • Patch Submitted:
    Yes

Description

Method SslSelectChannelConnector.customize(EndPoint endpoint, Request request) is never called from org.mortbay.jetty.HttpConnection, thus, the various attributes such as "javax.servlet.request.X509Certificate" are never set.

Here is a patch:

— a/modules/server/jetty-ssl/src/main/java/org/mortbay/jetty/security/SslSocketConnector.java
+++ b/modules/server/jetty-ssl/src/main/java/org/mortbay/jetty/security/SslSocketConnector.java
@@ -242,7 +242,7 @@ public class SslSocketConnector extends SocketConnector

  • This should be a {@link SocketEndPoint} wrapping a {@link SSLSocket}.
  • @param request HttpRequest to be customised.
    */
  • public void customize(EndPoint endpoint, Request request)
    + public void customize(org.mortbay.io.EndPoint endpoint, Request request)
    throws IOException
    {
    super.customize(endpoint, request);

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Greg Wilkins added a comment - 19/Apr/08 8:32 AM

customize is called from HttpConnection.handleRequest.

I just checked wit h6.1.9 and both SslSocketConnector and SslSelectChannelConnector call customize
and the javax.servlet.request.cipher_suite and javax.servlet.request.key_size attributes are set.

However, the javax.servlet.request.X509Certificate is not set because a javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated exception is thrown..... unless of course your client does provide a certificate.

So I'm closing this for now. Please re-open if I'm missing something?

Show
Greg Wilkins added a comment - 19/Apr/08 8:32 AM customize is called from HttpConnection.handleRequest. I just checked wit h6.1.9 and both SslSocketConnector and SslSelectChannelConnector call customize and the javax.servlet.request.cipher_suite and javax.servlet.request.key_size attributes are set. However, the javax.servlet.request.X509Certificate is not set because a javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated exception is thrown..... unless of course your client does provide a certificate. So I'm closing this for now. Please re-open if I'm missing something?
Hide
Permalink
Bruno Harbulot added a comment - 19/Apr/08 8:45 AM

I should have been clearer in the initial report. (I have tried with a client certificate.)

The problem is that EnpPoint is not the class that is expected, because it's one with the same name declared elsewhere.

In HttpConnection.handleRequest, there is a call to:

  • Connector.customize(org.mortbay.io.EndPoint endpoint, Request request)

However, in SslSocketConnector.customize(EndPoint endpoint, Request request) is in fact:
customize(org.mortbay.jetty.nio.SelectChannelConnector.EndPoint, Request request)

EndPoint resolves to that inner class of SelectChannelConnector instead of org.mortbay.io.EndPoint.

Thus, customize is overloaded and not overridden, and never actually called from within HttpConnection.handleRequest. The small patch I submitted only consists of declaring the full name, including package name.

Show
Bruno Harbulot added a comment - 19/Apr/08 8:45 AM I should have been clearer in the initial report. (I have tried with a client certificate.) The problem is that EnpPoint is not the class that is expected, because it's one with the same name declared elsewhere. In HttpConnection.handleRequest, there is a call to:
  • Connector.customize(org.mortbay.io.EndPoint endpoint, Request request)
However, in SslSocketConnector.customize(EndPoint endpoint, Request request) is in fact: customize(org.mortbay.jetty.nio.SelectChannelConnector.EndPoint, Request request) EndPoint resolves to that inner class of SelectChannelConnector instead of org.mortbay.io.EndPoint. Thus, customize is overloaded and not overridden, and never actually called from within HttpConnection.handleRequest. The small patch I submitted only consists of declaring the full name, including package name.
Hide
Permalink
Bruno Harbulot added a comment - 19/Apr/08 8:46 AM

(see comment I've just added after the issue was closed)

Show
Bruno Harbulot added a comment - 19/Apr/08 8:46 AM (see comment I've just added after the issue was closed)
Hide
Permalink
Bruno Harbulot added a comment - 19/Apr/08 9:30 AM

I think this is a issue that has been introduced after 6.1.9.

When I check the full signature using "javap org.mortbay.jetty.security.SslSelectChannelConnector",

using the file in "jetty-sslengine-6.1.9.jar", I get the correct signature:
public void customize(org.mortbay.io.EndPoint, org.mortbay.jetty.Request) throws java.io.IOException;

using the file in "~/.m2/repository/org/mortbay/jetty/jetty-ssl/7.0-SNAPSHOT/jetty-ssl-7.0-20080402.074908-1.jar", I get:
public void customize(org.mortbay.jetty.nio.SelectChannelConnector$EndPoint, org.mortbay.jetty.Request) throws java.io.IOException;

In the current snapshot, it's using the wrong class.

Show
Bruno Harbulot added a comment - 19/Apr/08 9:30 AM I think this is a issue that has been introduced after 6.1.9. When I check the full signature using "javap org.mortbay.jetty.security.SslSelectChannelConnector", using the file in "jetty-sslengine-6.1.9.jar", I get the correct signature: public void customize(org.mortbay.io.EndPoint, org.mortbay.jetty.Request) throws java.io.IOException; using the file in "~/.m2/repository/org/mortbay/jetty/jetty-ssl/7.0-SNAPSHOT/jetty-ssl-7.0-20080402.074908-1.jar", I get: public void customize(org.mortbay.jetty.nio.SelectChannelConnector$EndPoint, org.mortbay.jetty.Request) throws java.io.IOException; In the current snapshot, it's using the wrong class.
Hide
Permalink
Greg Wilkins added a comment - 19/Apr/08 10:36 AM

Ah thanks for the clarification! I missed that.

fixed in svn now.

Show
Greg Wilkins added a comment - 19/Apr/08 10:36 AM Ah thanks for the clarification! I missed that. fixed in svn now.
Hide
Permalink
Bruno Harbulot added a comment - 20/Apr/08 1:21 PM

Cheers! Sorry I should have given more details initially.

Show
Bruno Harbulot added a comment - 20/Apr/08 1:21 PM Cheers! Sorry I should have given more details initially.

People

  • Assignee:
    Greg Wilkins
    Reporter:
    Bruno Harbulot
Vote (0)
Watch (1)

Dates

  • Created:
    15/Apr/08 6:04 PM
    Updated:
    20/Apr/08 1:21 PM
    Resolved:
    19/Apr/08 10:36 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.