You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Francois Rigault (JIRA)" <ji...@apache.org> on 2010/05/06 14:55:49 UTC

[jira] Created: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

NullPointerException in NegotiateScheme
---------------------------------------

                 Key: HTTPCLIENT-936
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.1 Alpha1
         Environment: JDK1.6
            Reporter: Francois Rigault


- server is configured to allow client to authenticate with kerberos with principal foobar
- client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory

- when the client authenticate with the (correct) principal foobar, it works !
- when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.


Exception in thread "main" java.lang.NullPointerException
	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)


-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Francois Rigault updated HTTPCLIENT-936:
----------------------------------------


Hi

I have an infinite loop now.

start:
The client sends its token to the server ,
Server replies with a  WWW-Authenticate:  Negotiate sometoken
Client gets a new token from the kdc
It also gets a new token from the kdc for accessing the krbtgt, don't know why
goto start

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: HTTPCLIENT-936.patch
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski updated HTTPCLIENT-936:
-----------------------------------------

    Fix Version/s:     (was: 4.1 Alpha2)

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>         Attachments: HTTPCLIENT-936.patch
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Francois Rigault updated HTTPCLIENT-936:
----------------------------------------


works like a charm !

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: HTTPCLIENT-936-fix.patch, patchAddUnitTestsForNegotiateScheme.txt, patchCommonsApi.txt
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski updated HTTPCLIENT-936:
-----------------------------------------

    Fix Version/s: 4.1 Alpha2

Fantastic! Works (or rather does not work) like a charm! I love test cases! Working on a fix

Oleg 

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: HTTPCLIENT-936.patch, patchAddUnitTestsForNegotiateScheme.txt, patchCommonsApi.txt
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Francois Rigault updated HTTPCLIENT-936:
----------------------------------------

    Attachment: patchCommonsApi.txt

First patch to apply. Included:
- fix for API change in apache-commons (negotiate was not working with commons 1.4)
- add a way to inject a custom GSSManager for unit tests


> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>         Attachments: HTTPCLIENT-936.patch, patchCommonsApi.txt
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski resolved HTTPCLIENT-936.
------------------------------------------

    Resolution: Fixed

Patch checked in

Oleg

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: HTTPCLIENT-936-fix.patch, patchAddUnitTestsForNegotiateScheme.txt, patchCommonsApi.txt
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski updated HTTPCLIENT-936:
-----------------------------------------

    Fix Version/s: 4.1 Alpha2
      Component/s: HttpAuth
                       (was: HttpClient)

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski updated HTTPCLIENT-936:
-----------------------------------------

    Attachment:     (was: HTTPCLIENT-936.patch)

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: patchAddUnitTestsForNegotiateScheme.txt, patchCommonsApi.txt
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Francois Rigault updated HTTPCLIENT-936:
----------------------------------------

    Attachment: patchAddUnitTestsForNegotiateScheme.txt

> I cannot reproduce it locally
now you can :)

this one depends on the first patch (patchCommonsApi)

waiting for your comments

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>         Attachments: HTTPCLIENT-936.patch, patchAddUnitTestsForNegotiateScheme.txt, patchCommonsApi.txt
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski updated HTTPCLIENT-936:
-----------------------------------------

    Attachment: HTTPCLIENT-936-fix.patch

Francois,

This patch fixes the problem for me. Both test cases pass now. Please try it out.

If I hear no complaints I'll commit the patch and close the issue in a day or two.

Oleg 

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: HTTPCLIENT-936-fix.patch, patchAddUnitTestsForNegotiateScheme.txt, patchCommonsApi.txt
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski commented on HTTPCLIENT-936:
----------------------------------------------

Francois

Could you please generate a wire / context log of the HTTP session and attach it to this issue? 

http://hc.apache.org/httpcomponents-client/logging.html

I also have to say I probably will not be able to do much about this problem as I cannot reproduce it locally. Please do consider investing some effort into fixing the bug in your environment and contributing the fix back to the community.

Oleg

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: HTTPCLIENT-936.patch
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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] Updated: (HTTPCLIENT-936) NullPointerException in NegotiateScheme

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

Oleg Kalnichevski updated HTTPCLIENT-936:
-----------------------------------------

    Attachment: HTTPCLIENT-936.patch

Try this patch out. You will need to upgrade to the latest code snapshot from SVN trunk.

Oleg

> NullPointerException in NegotiateScheme
> ---------------------------------------
>
>                 Key: HTTPCLIENT-936
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-936
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.1 Alpha1
>         Environment: JDK1.6
>            Reporter: Francois Rigault
>             Fix For: 4.1 Alpha2
>
>         Attachments: HTTPCLIENT-936.patch
>
>
> - server is configured to allow client to authenticate with kerberos with principal foobar
> - client, using httpclient with a registered authscheme SPNEGO set as a NegotiateSchemeFactory
> - when the client authenticate with the (correct) principal foobar, it works !
> - when the client authenticate with the (wrong) principal fooba, it fails with a NPE below.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:233)
> 	at org.apache.commons.codec.binary.Base64.encode(Base64.java:521)
> 	at org.apache.http.impl.auth.NegotiateScheme.authenticate(NegotiateScheme.java:240)
> 	at org.apache.http.client.protocol.RequestTargetAuthentication.process(RequestTargetAuthentication.java:99)
> 	at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
> 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:460)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:689)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:624)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:602)

-- 
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