-
Notifications
You must be signed in to change notification settings - Fork 20
Rest mutual auth fix #279
Rest mutual auth fix #279
Conversation
a8865b5
to
b881fc8
Compare
Previously we had 1 sided TLS on the server side. Data between the client and server was send over an encrypted channel, but any client could make requests to the server. This commit changes the behavior so that only clients with the matching certificates can make requests to the server when TLS is enabled. This commit does NOT add support for installing a trust manager. That must be added in the future.
This commit makes the PerformanceAnalyzerWebServer authenticate clients if the user specifies a certificate authority. It also properly sets up the server's identity, so that any clients can authenticate the server.
67d53d5
to
8894129
Compare
Codecov Report
@@ Coverage Diff @@
## master #279 +/- ##
============================================
+ Coverage 66.71% 67.16% +0.44%
- Complexity 1869 1882 +13
============================================
Files 276 276
Lines 12307 12338 +31
Branches 982 983 +1
============================================
+ Hits 8211 8287 +76
+ Misses 3764 3718 -46
- Partials 332 333 +1
Continue to review full report at Codecov.
|
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.
LGTM. One minor whitespace nit.
* ClientAuthConfigurator makes the server perform client authentication if the user has set up a | ||
* certificate authority | ||
*/ | ||
private static class ClientAuthConfigurator extends HttpsConfigurator { |
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.
nit: additional space. static class -> static class
One more thing, can you link the issue by changing |
server.setHttpsConfigurator(new ClientAuthConfigurator(sslContext)); | ||
|
||
|
||
// TODO ask ktkrg why this is necessary |
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.
Do you plan to wrap up the TODO in this PR or in a follow up ?
Issue #, if available: #278
Description of changes: Adds configurable auth to REST endpoints
Tests: TestNetServer
Code coverage percentage for this patch: See CodeCov report
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.