Re: Websocket client with SSL and authentication

2017-03-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

To whom it may concern.

On 3/9/17 8:41 PM, radiatejava wrote:
> Tomcat team, I have few questions on websocket:
> 
> 1. I am looking for Java websocket client sample code that uses
> basic (user) auth.

AIUI, you'll have to authenticate using standard HTTP
WWW-Authenticate, and *then* upgrade your connection to WebSocket.

> 2. Is there any sample code for how to put in SSL (keystore and 
> truststore) websocket client ?

https://bz.apache.org/bugzilla/show_bug.cgi?id=55801

Specify an SSLContext in your user properties:

http://tomcat.apache.org/tomcat-8.0-doc/web-socket-howto.html#Tomcat_Web
Socket_specific_configuration

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYwu4MAAoJEBzwKT+lPKRYreEQALIPJL4tmb9dOL7S+Phhh/YO
Kxw77Gj7Axm6OG6f6i7CKINIHJcOoZrzZiMTFOE4aqdVbWkePafwIXbOZV8sD1et
GPgvVHrpbGtJOc9C1Z8fxkGDn78fFFjPc6weKoyQMUAu2Glc7ux77J6kESZp3QVL
fbKdf/iE0aXRUf1XX074KrPgTjZEzvglJUz87jwrq8YtRsKp8KW1XWQ+RdW9TxOh
gRYe8a9Oap8/QBZwbpkQIOxRZqDSQjYg8rsma/aBA0Q4heLz1gmZJMlxcc6FRaIu
VpifrHj3SV2YCig/oTU2iH+LSvZVJI1AHeMvTTqLNO0J6QGnTXN0BTsUHVDbHjeW
c59MbUIkF5qVK1gUTETiMtdOxBBVNv6IbU8oAaITZ4OoZPk3/IVRV2UPmN3oCqD3
IdsLKPNRN7y/9UKjs8cNdo8vqg3rDKL7xLAkBcIJKmo0GCrUFXC9XfSUgV9BAQih
R41QoyHxPRNxv8LCnqX/rA1718oLoMDXfq2K7QviJfo2crn65kM6OvdGuml7llBX
h/tl02gAIoapdnkool9gi34/opuWmfiY4kluZUBAIp5r/0QYd7WKa78fimv1GQVC
pMnhcaD3P1tadeaDIFl92yUVWIXbcCGpiUC9ZBRg7FlW3Ttl1wXaDQ+E/rkKVk2l
wLNTn5gLK3xPR++txDaK
=W59o
-END PGP SIGNATURE-

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



Re: Websocket client with SSL and authentication

2017-03-10 Thread Ludovic PĂ©net

On 10/03/2017 02:41, radiatejava wrote:

Tomcat team, I have few questions on websocket:

Hi.

I am not member of the Tomcat team, but I will try to give you some 
answer or hints...


[...]


2. Is there any sample code for how to put in SSL (keystore and
truststore) websocket client ?

You should set that up at the JVM level, IMHO.

If you really want to do that specifically for the WS client, you can see

https://github.com/apache/tomcat/blob/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java


3. I want to create a websocket client within the Tomcat jvm. I know
there is an example TestWebSocketFrameClientSSL.java as part of Tomcat
project but wanted to know if that is the only way to create a
websocket. For example, if I have other websocket implementation
libraries in my tomcat server lib folder, how do I ensure I get the
implementation I want ? Which websocket implementation will I get when
I do : ContainerProvider.getWebSocketContainer();

I had a similar problem, as I use both Tyrus and Tomcat WS clients.

The implementation returned by

ContainerProvider.getWebSocketContainer()

was undefined. Sometimes Tyrus, sometimes Tomcat.

So, I instantiate the specific type of each lib to be sure of what I 
get. For Tomcat WS client, this is :


WebSocketContainer container = new WsWebSocketContainer();

Hope this helps,

Ludovic

|
| AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
|


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



Websocket client with SSL and authentication

2017-03-09 Thread radiatejava
Tomcat team, I have few questions on websocket:

1. I am looking for Java websocket client sample code that uses basic
(user) auth.
2. Is there any sample code for how to put in SSL (keystore and
truststore) websocket client ?
3. I want to create a websocket client within the Tomcat jvm. I know
there is an example TestWebSocketFrameClientSSL.java as part of Tomcat
project but wanted to know if that is the only way to create a
websocket. For example, if I have other websocket implementation
libraries in my tomcat server lib folder, how do I ensure I get the
implementation I want ? Which websocket implementation will I get when
I do : ContainerProvider.getWebSocketContainer();

Thanks.

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