-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
SSLEngineWebSocketServerFactory allows more customization #839
SSLEngineWebSocketServerFactory allows more customization #839
Conversation
this(sslEngine, Executors.newSingleThreadScheduledExecutor()); | ||
} | ||
|
||
private SSLEngineWebSocketServerFactory(SSLEngine sslEngine, ExecutorService exec) { |
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.
Is there any specific reason why this constructor is private and not public?
|
||
@Override | ||
public void close() { | ||
|
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.
Looks like DefaultSSLWebSocketServerFactory closes the executor service in it's close
method. Maybe it should be done here as well.
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.
maybe even extend from DefaultSSLWebSocketServerFactory?
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.
Could you please include a basic unit test?
Comments addressed, simple unit test included. |
* | ||
* @param sslContext - can not be <code>null</code> | ||
* @param executerService - can not be <code>null</code> | ||
* @param sslParameters - sslParameters |
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.
sslParameters cannot be null, could you please adjust the JavaDoc
public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException { | ||
SSLEngine e = sslcontext.createSSLEngine(); | ||
e.setUseClientMode(false); | ||
if (sslParameters != null) { |
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.
No check needed since we throw an IllegalArgumentException()
@BroHammie sorry for again requesting changes :( |
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.
Looking good for me @PhilipRoman?
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.
👍
@BroHammie thank you again for your contribution! |
Description
Introduces a new class SSLEngineWebSocketServerFactory that takes a SSLEngine as parameter allowing for more customization.
Related Issue
#838
Motivation and Context
Now I can create a WebSocketServerFactory with a SSLEngine that has NeedClientAuth set to true, thus making Server request a client certificate on connect.
How Has This Been Tested?
Created a TwoWaySSLServerExample(included in PR) that sets the value. Running wireshark with and without that flag set I can see a difference and the server sending a "client certificate request"
Types of changes
Checklist: