You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jean-Louis MONTEIRO <je...@gmail.com> on 2014/08/06 15:54:41 UTC

AuthenticatorBase bug using SSL?

Hello guys,

I'm currently facing an issue with the BaseAuthenticator.
Before opening a issue on the bug tracker, I'd like to get your opinion
guys.

The use case is simple: use an HTTPS tomcat connector with mutual
authentication (CLIENT-CERT).

It does not involve at all any front serveur like Apache HTTPD.

Everything works fine until you want to add the SSLAuthenticator valve with
the preemptive mode.
At the end of the invoke method (AuthenticatorBase), the presence of the
X509 certificate is checked under the usual key (ie.
request.getAttribute(Globals.CERTIFICATES_ATTR)).

This works fine when using an Apache HTTPD front, but does not work with
tomcat SSL connectors cause the request is not populated.

If you check the Authenticate of the SSLAuthenticator that should be invoke
is a certificate is found, if nothing is found in the request under the
usual key, the following is done before trying again

request.getCoyoteRequest().action(ActionCode.REQ_SSL_CERTIFICATE, null);

Roughly and simply speaking, the certificat is going to be extracted from
the coyote request and the entry in the HTTP request is populated.

I'm wondering why it's not done also in the AuthenticatorBase?
It makes it impossible to use the preemptive mode with the SSLAuthenticator
valve.

I think creating a getRequestCertificate() method in the AuthenticatorBase
that wraps up the logic of calling or not the coyote request would do the
trick. Then it's just a matter of using it in the invoke method
(AuthenticatorBase) or in the authenticate (SSLAuthenticator).

Feedback welcome so that I can create a JIRA and submit a patch if you want.

-- 
Jean-Louis

Re: AuthenticatorBase bug using SSL?

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
2014-08-06 16:19 GMT+02:00 Mark Thomas <ma...@apache.org>:

> On 06/08/2014 14:54, Jean-Louis MONTEIRO wrote:
> > Hello guys,
> >
> > I'm currently facing an issue with the BaseAuthenticator.
> > Before opening a issue on the bug tracker, I'd like to get your opinion
> > guys.
>
> The members of this list include both men and women. Please use a more
> inclusive term than "guys".
>
>
My apologize if I offended someone, it was definitely my intention.

I've always used "you guys" when addressing a group of men, or a group of
women, or a group of mixed gender.
English is not my main langage, that's why I probably abused the term.

Never heard girls or ladies complaining until now. Amazing situation that a
guy is actually complaining :)

Not the purpose of the post nor the mailing list.
Thanks anyway for the answer, I gonna open an issue.

Jean-Louis

Re: AuthenticatorBase bug using SSL?

Posted by Mark Thomas <ma...@apache.org>.
On 06/08/2014 14:54, Jean-Louis MONTEIRO wrote:
> Hello guys,
> 
> I'm currently facing an issue with the BaseAuthenticator.
> Before opening a issue on the bug tracker, I'd like to get your opinion
> guys.

The members of this list include both men and women. Please use a more
inclusive term than "guys".

> The use case is simple: use an HTTPS tomcat connector with mutual
> authentication (CLIENT-CERT).
> 
> It does not involve at all any front serveur like Apache HTTPD.
> 
> Everything works fine until you want to add the SSLAuthenticator valve with
> the preemptive mode.
> At the end of the invoke method (AuthenticatorBase), the presence of the
> X509 certificate is checked under the usual key (ie.
> request.getAttribute(Globals.CERTIFICATES_ATTR)).
> 
> This works fine when using an Apache HTTPD front, but does not work with
> tomcat SSL connectors cause the request is not populated.
> 
> If you check the Authenticate of the SSLAuthenticator that should be invoke
> is a certificate is found, if nothing is found in the request under the
> usual key, the following is done before trying again
> 
> request.getCoyoteRequest().action(ActionCode.REQ_SSL_CERTIFICATE, null);
> 
> Roughly and simply speaking, the certificat is going to be extracted from
> the coyote request and the entry in the HTTP request is populated.
> 
> I'm wondering why it's not done also in the AuthenticatorBase?

An oversight.

> It makes it impossible to use the preemptive mode with the SSLAuthenticator
> valve.
> 
> I think creating a getRequestCertificate() method in the AuthenticatorBase
> that wraps up the logic of calling or not the coyote request would do the
> trick. Then it's just a matter of using it in the invoke method
> (AuthenticatorBase) or in the authenticate (SSLAuthenticator).

Agreed.

> Feedback welcome so that I can create a JIRA and submit a patch if you want.

Patches welcome (via Bugzilla, Tomcat doesn't use JIRA).

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org