You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joseph Mokos <Jo...@riverbed.com> on 2018/04/13 16:44:40 UTC

Proxy authentication support for the Tomcat Websocket Client

I'm writing a websocket client using the Tomcat JSR356 compliant websocket library.  My client must connect through a proxy that requires authentication.  I've successfully connected through the proxy without authentication using  the JDK ProxySelector.  But I can't figure out how to configure proxy authentication.  I have checked the connectToServer code in WsWebSocketContainer.java and it appears that proxy authentication is not supported.  Can someone confirm whether proxy authentication is or is not supported by the library?




RE: Proxy authentication support for the Tomcat Websocket Client

Posted by Joseph Mokos <Jo...@riverbed.com>.
Mark

See bug 62312.

Joe

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: Wednesday, April 18, 2018 10:11 AM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: Proxy authentication support for the Tomcat Websocket Client

On 18/04/18 14:59, Joseph Mokos wrote:
> Mark
> 
> Thank you for confirming.
> 
> Proxy authentication is a requirement for the project I am working on so I went and added it.  You are welcome to the code if you want it.  I pass the credentials as user properties in the WebSocketContainer's ClientEndpointConfig object. This is how it was done with HTTP authentication.  As a matter of fact, the code is very similar to the HTTP authentication.
> 
> Let me know if you want the code.

Sure.

Patches are always welcome.

The list often strips and/or mangles formatting for attachments so best to create a Bugzilla issue and attach your patch there.

Thanks,

Mark


> 
> Joe
> 
> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Wednesday, April 18, 2018 7:11 AM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: Proxy authentication support for the Tomcat Websocket 
> Client
> 
> On 13/04/18 17:44, Joseph Mokos wrote:
>> I'm writing a websocket client using the Tomcat JSR356 compliant websocket library.  My client must connect through a proxy that requires authentication.  I've successfully connected through the proxy without authentication using  the JDK ProxySelector.  But I can't figure out how to configure proxy authentication.  I have checked the connectToServer code in WsWebSocketContainer.java and it appears that proxy authentication is not supported.  Can someone confirm whether proxy authentication is or is not supported by the library?
> 
> Looking at the code, I can confirm that proxy authentication is not supported.
> 
> Adding proxy authentication support looks fairly simple.
> The biggest question looks to be be what API to use to specify the credentials.
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


RE: Proxy authentication support for the Tomcat Websocket Client

Posted by Joseph Mokos <Jo...@riverbed.com>.
Mark

I created a patch file off the git branch and attached that to bug 62312.

Joe

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: Wednesday, April 18, 2018 12:00 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: RE: Proxy authentication support for the Tomcat Websocket Client

On 18 April 2018 15:14:09 BST, Joseph Mokos <Jo...@riverbed.com> wrote:
>Mark
>
>I have the changes in a git branch I forked off of the trunk.  Is there 
>some way I can push that branch up to you?

PRs against github.com/apache/tomcat work too.

We have to manually apply them to svn (until we migrate to git) but that is not a major hassle.

Mark

>
>Joe
>
>-----Original Message-----
>From: Mark Thomas [mailto:markt@apache.org]
>Sent: Wednesday, April 18, 2018 10:11 AM
>To: Tomcat Users List <us...@tomcat.apache.org>
>Subject: Re: Proxy authentication support for the Tomcat Websocket 
>Client
>
>On 18/04/18 14:59, Joseph Mokos wrote:
>> Mark
>> 
>> Thank you for confirming.
>> 
>> Proxy authentication is a requirement for the project I am working on
>so I went and added it.  You are welcome to the code if you want it.  I 
>pass the credentials as user properties in the WebSocketContainer's 
>ClientEndpointConfig object. This is how it was done with HTTP 
>authentication.  As a matter of fact, the code is very similar to the 
>HTTP authentication.
>> 
>> Let me know if you want the code.
>
>Sure.
>
>Patches are always welcome.
>
>The list often strips and/or mangles formatting for attachments so best 
>to create a Bugzilla issue and attach your patch there.
>
>Thanks,
>
>Mark
>
>
>> 
>> Joe
>> 
>> -----Original Message-----
>> From: Mark Thomas [mailto:markt@apache.org]
>> Sent: Wednesday, April 18, 2018 7:11 AM
>> To: Tomcat Users List <us...@tomcat.apache.org>
>> Subject: Re: Proxy authentication support for the Tomcat Websocket 
>> Client
>> 
>> On 13/04/18 17:44, Joseph Mokos wrote:
>>> I'm writing a websocket client using the Tomcat JSR356 compliant
>websocket library.  My client must connect through a proxy that 
>requires authentication.  I've successfully connected through the proxy 
>without authentication using  the JDK ProxySelector.  But I can't 
>figure out how to configure proxy authentication.  I have checked the 
>connectToServer code in WsWebSocketContainer.java and it appears that 
>proxy authentication is not supported.  Can someone confirm whether 
>proxy authentication is or is not supported by the library?
>> 
>> Looking at the code, I can confirm that proxy authentication is not
>supported.
>> 
>> Adding proxy authentication support looks fairly simple.
>> The biggest question looks to be be what API to use to specify the
>credentials.
>> 
>> Mark
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>>


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


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


RE: Proxy authentication support for the Tomcat Websocket Client

Posted by Mark Thomas <ma...@apache.org>.
On 18 April 2018 15:14:09 BST, Joseph Mokos <Jo...@riverbed.com> wrote:
>Mark
>
>I have the changes in a git branch I forked off of the trunk.  Is there
>some way I can push that branch up to you?

PRs against github.com/apache/tomcat work too.

We have to manually apply them to svn (until we migrate to git) but that is not a major hassle.

Mark

>
>Joe
>
>-----Original Message-----
>From: Mark Thomas [mailto:markt@apache.org] 
>Sent: Wednesday, April 18, 2018 10:11 AM
>To: Tomcat Users List <us...@tomcat.apache.org>
>Subject: Re: Proxy authentication support for the Tomcat Websocket
>Client
>
>On 18/04/18 14:59, Joseph Mokos wrote:
>> Mark
>> 
>> Thank you for confirming.
>> 
>> Proxy authentication is a requirement for the project I am working on
>so I went and added it.  You are welcome to the code if you want it.  I
>pass the credentials as user properties in the WebSocketContainer's
>ClientEndpointConfig object. This is how it was done with HTTP
>authentication.  As a matter of fact, the code is very similar to the
>HTTP authentication.
>> 
>> Let me know if you want the code.
>
>Sure.
>
>Patches are always welcome.
>
>The list often strips and/or mangles formatting for attachments so best
>to create a Bugzilla issue and attach your patch there.
>
>Thanks,
>
>Mark
>
>
>> 
>> Joe
>> 
>> -----Original Message-----
>> From: Mark Thomas [mailto:markt@apache.org]
>> Sent: Wednesday, April 18, 2018 7:11 AM
>> To: Tomcat Users List <us...@tomcat.apache.org>
>> Subject: Re: Proxy authentication support for the Tomcat Websocket 
>> Client
>> 
>> On 13/04/18 17:44, Joseph Mokos wrote:
>>> I'm writing a websocket client using the Tomcat JSR356 compliant
>websocket library.  My client must connect through a proxy that
>requires authentication.  I've successfully connected through the proxy
>without authentication using  the JDK ProxySelector.  But I can't
>figure out how to configure proxy authentication.  I have checked the
>connectToServer code in WsWebSocketContainer.java and it appears that
>proxy authentication is not supported.  Can someone confirm whether
>proxy authentication is or is not supported by the library?
>> 
>> Looking at the code, I can confirm that proxy authentication is not
>supported.
>> 
>> Adding proxy authentication support looks fairly simple.
>> The biggest question looks to be be what API to use to specify the
>credentials.
>> 
>> Mark
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>>


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


RE: Proxy authentication support for the Tomcat Websocket Client

Posted by Joseph Mokos <Jo...@riverbed.com>.
Mark

I have the changes in a git branch I forked off of the trunk.  Is there some way I can push that branch up to you?

Joe

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: Wednesday, April 18, 2018 10:11 AM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: Proxy authentication support for the Tomcat Websocket Client

On 18/04/18 14:59, Joseph Mokos wrote:
> Mark
> 
> Thank you for confirming.
> 
> Proxy authentication is a requirement for the project I am working on so I went and added it.  You are welcome to the code if you want it.  I pass the credentials as user properties in the WebSocketContainer's ClientEndpointConfig object. This is how it was done with HTTP authentication.  As a matter of fact, the code is very similar to the HTTP authentication.
> 
> Let me know if you want the code.

Sure.

Patches are always welcome.

The list often strips and/or mangles formatting for attachments so best to create a Bugzilla issue and attach your patch there.

Thanks,

Mark


> 
> Joe
> 
> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Wednesday, April 18, 2018 7:11 AM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: Proxy authentication support for the Tomcat Websocket 
> Client
> 
> On 13/04/18 17:44, Joseph Mokos wrote:
>> I'm writing a websocket client using the Tomcat JSR356 compliant websocket library.  My client must connect through a proxy that requires authentication.  I've successfully connected through the proxy without authentication using  the JDK ProxySelector.  But I can't figure out how to configure proxy authentication.  I have checked the connectToServer code in WsWebSocketContainer.java and it appears that proxy authentication is not supported.  Can someone confirm whether proxy authentication is or is not supported by the library?
> 
> Looking at the code, I can confirm that proxy authentication is not supported.
> 
> Adding proxy authentication support looks fairly simple.
> The biggest question looks to be be what API to use to specify the credentials.
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


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


Re: Proxy authentication support for the Tomcat Websocket Client

Posted by Mark Thomas <ma...@apache.org>.
On 18/04/18 14:59, Joseph Mokos wrote:
> Mark
> 
> Thank you for confirming.
> 
> Proxy authentication is a requirement for the project I am working on so I went and added it.  You are welcome to the code if you want it.  I pass the credentials as user properties in the WebSocketContainer's ClientEndpointConfig object. This is how it was done with HTTP authentication.  As a matter of fact, the code is very similar to the HTTP authentication.
> 
> Let me know if you want the code.

Sure.

Patches are always welcome.

The list often strips and/or mangles formatting for attachments so best
to create a Bugzilla issue and attach your patch there.

Thanks,

Mark


> 
> Joe
> 
> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org] 
> Sent: Wednesday, April 18, 2018 7:11 AM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: Proxy authentication support for the Tomcat Websocket Client
> 
> On 13/04/18 17:44, Joseph Mokos wrote:
>> I'm writing a websocket client using the Tomcat JSR356 compliant websocket library.  My client must connect through a proxy that requires authentication.  I've successfully connected through the proxy without authentication using  the JDK ProxySelector.  But I can't figure out how to configure proxy authentication.  I have checked the connectToServer code in WsWebSocketContainer.java and it appears that proxy authentication is not supported.  Can someone confirm whether proxy authentication is or is not supported by the library?
> 
> Looking at the code, I can confirm that proxy authentication is not supported.
> 
> Adding proxy authentication support looks fairly simple.
> The biggest question looks to be be what API to use to specify the credentials.
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


RE: Proxy authentication support for the Tomcat Websocket Client

Posted by Joseph Mokos <Jo...@riverbed.com>.
Mark

Thank you for confirming.

Proxy authentication is a requirement for the project I am working on so I went and added it.  You are welcome to the code if you want it.  I pass the credentials as user properties in the WebSocketContainer's ClientEndpointConfig object. This is how it was done with HTTP authentication.  As a matter of fact, the code is very similar to the HTTP authentication.

Let me know if you want the code.

Joe

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: Wednesday, April 18, 2018 7:11 AM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: Proxy authentication support for the Tomcat Websocket Client

On 13/04/18 17:44, Joseph Mokos wrote:
> I'm writing a websocket client using the Tomcat JSR356 compliant websocket library.  My client must connect through a proxy that requires authentication.  I've successfully connected through the proxy without authentication using  the JDK ProxySelector.  But I can't figure out how to configure proxy authentication.  I have checked the connectToServer code in WsWebSocketContainer.java and it appears that proxy authentication is not supported.  Can someone confirm whether proxy authentication is or is not supported by the library?

Looking at the code, I can confirm that proxy authentication is not supported.

Adding proxy authentication support looks fairly simple.
The biggest question looks to be be what API to use to specify the credentials.

Mark

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


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


Re: Proxy authentication support for the Tomcat Websocket Client

Posted by Mark Thomas <ma...@apache.org>.
On 13/04/18 17:44, Joseph Mokos wrote:
> I'm writing a websocket client using the Tomcat JSR356 compliant websocket library.  My client must connect through a proxy that requires authentication.  I've successfully connected through the proxy without authentication using  the JDK ProxySelector.  But I can't figure out how to configure proxy authentication.  I have checked the connectToServer code in WsWebSocketContainer.java and it appears that proxy authentication is not supported.  Can someone confirm whether proxy authentication is or is not supported by the library?

Looking at the code, I can confirm that proxy authentication is not
supported.

Adding proxy authentication support looks fairly simple.
The biggest question looks to be be what API to use to specify the
credentials.

Mark

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