-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebSocket] SSL Support for WebSocket Client. #205
[WebSocket] SSL Support for WebSocket Client. #205
Conversation
ce8f4b1
to
1046484
Compare
} | ||
return Util.getSSLConfigForSender(certPass, keyStorePassword, keyStoreFile, trustStoreFile, trustStorePass, | ||
parameters, sslProtocol, tlsStoreType); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add javadoc to the public methods?
@@ -19,31 +19,15 @@ | |||
|
|||
package org.wso2.transport.http.netty.contract.websocket; | |||
|
|||
import java.nio.ByteBuffer; | |||
|
|||
/** | |||
* This message contains the details of WebSocket bong message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a bong message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't know what a bong message is. Maybe this https://www.discogs.com/artist/7888-Bong-Messages :D
Anyway this is a typo and I will update this java doc with a valid description.
c092c34
to
d92d208
Compare
* @param sslConfig ssl related configurations | ||
* @return ssl engine | ||
*/ | ||
private SSLEngine instantiateAndConfigSSL(SSLConfig sslConfig, String host, int port) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the same instantiateAndConfigSSL(..) method in Util class making it public?
Assert.assertNotNull(throwable); | ||
Assert.assertTrue(throwable instanceof IllegalArgumentException); | ||
Assert.assertEquals(throwable.getMessage(), | ||
"TrustStoreFile or trustStorePassword not defined for HTTPS/WSS_SCHEME scheme"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be '... HTTPS/WSS scheme'
Assert.assertEquals(throwable.getMessage(), "General SSLEngine problem"); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we remove these 2 empty lines?
Assert.assertEquals(clientConnectorListener.getReceivedTextToClient(), testText); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we remove these 2 empty lines?
e47f3aa
to
e2f9183
Compare
private void configureHandshakePipeline(ChannelPipeline pipeline) { | ||
pipeline.addLast(new HttpClientCodec()); | ||
// Assuming that WebSocket Handshake messages will not be large than 8KB | ||
pipeline.addLast(new HttpObjectAggregator(8192)); // TODO: Use constant if has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the TODO here?
return 443; | ||
default: | ||
return -1; | ||
case "ws": // TODO: Constants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we fix the TODO here?
this.clientHandshakeFuture = clientHandshakeFuture; | ||
} | ||
|
||
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect formatting
import static org.wso2.transport.http.netty.util.TestUtil.WEBSOCKET_TEST_IDLE_TIMEOUT; | ||
import static java.util.concurrent.TimeUnit.SECONDS; | ||
|
||
public class WebSocketSSLHandshakeFailureTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add a class java doc?
@@ -82,6 +82,8 @@ | |||
<class name="org.wso2.transport.http.netty.websocket.client.WebSocketClientHandshakeFunctionalityTestCase"/> | |||
<class name="org.wso2.transport.http.netty.websocket.client.WebSocketClientFunctionalityTestCase"/> | |||
<class name="org.wso2.transport.http.netty.websocket.passthrough.WebSocketPassThroughTestCase"/> | |||
<class name="org.wso2.transport.http.netty.websocket.ssl.WebSocketSSLHandshakeSuccessfulTestCase"/> | |||
<class name="org.wso2.transport.http.netty.websocket.ssl.WebSocketSSLHandshakeFailureTestCase"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add the org.wso2.transport.http.netty.websocket
package instead of individual classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done as a separate task for all the test cases after a careful inspection.
Created a issue to track this #212
e2f9183
to
88a504f
Compare
88a504f
to
17acfa8
Compare
17acfa8
to
9cfb53a
Compare
…development iteration
Purpose
Goals
Automation tests
Security checks