Skip to content
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

Full Keystore, Truststore and ClientAuth support #199

Closed
wants to merge 2 commits into from

Conversation

t1ngj13
Copy link

@t1ngj13 t1ngj13 commented Dec 3, 2014

As of 1.52, wiremock only supports specifying https port with a keystore, and keystore password is always assumed to be "password". This is quite limited. In many scenario, we want to specify more advanced parameters, for example:

  1. As a user, I would like to use my existing keystore, which has password other than 'password'
  2. As a user, I would like to start a stub server that only accepts request from my testing target that has specific client certificate (i.e., mutual SSL support

This pull request essentially exposes more native Jetty connector parameters through the HttpsSettings class, from which we will be able to specify the following parameters:

  • HTTPS port
  • Keystore Path and password
  • Truststore Path and password
  • Whether client auth is required

To maintain backward compatibility, default keystore password is still kept as 'password' if it is not specified.

@tomakehurst
Copy link
Member

This looks good, but please could you add some tests and documentation?

Thanks,
Tom

@tomakehurst
Copy link
Member

Strange coincidence but I also got this PR, for exactly the same thing:
https://github.com/tomakehurst/wiremock/pull/201

The other PR has some decent looking tests, but doesn't add the relevant CLI params whereas this PR does, but lacks tests.

Perhaps you and @ke4roh could get your heads together and combine the two?

@t1ngj13
Copy link
Author

t1ngj13 commented Dec 7, 2014

Thanks for the review! I made another commit to add UT and IT to cover the new feature.

This commit added UT and IT to cover the SSL support featre. Namely:
  * Introduced RestAssured as the client to simplify the testing code
  * Create a set of PKI and CA for testing different combinations of keystore and turststore in local environment
  * Added UT to cover HttpsSettings, WireMockConfiguration and CommandLineOptions class
  * Added IT to cover the case where WireMock server quires client auth
@t1ngj13
Copy link
Author

t1ngj13 commented Dec 8, 2014

Hi Tom - Just want to check if there is any further comments on the updated test case?

@tomakehurst
Copy link
Member

I'm having a bit of trouble making sense of this PR because you seem to have reformatted all the files you've opened. Also, I'd prefer not to introduce a new test framework at this stage.

Could you re-issue with formatting fixed and using HTTPClient for the testing?

@t1ngj13
Copy link
Author

t1ngj13 commented Dec 13, 2014

OK, I will update the issues during this weekend. Thanks!

@ke4roh
Copy link

ke4roh commented Dec 13, 2014

Jay,

You might like to just grab the tests from here:
https://github.com/ke4roh/wiremock/pull/1

Jim

On Fri, Dec 12, 2014 at 7:52 PM, Jay Zhu notifications@github.com wrote:

OK, I will update the issues during this weekend. Thanks!


Reply to this email directly or view it on GitHub
https://github.com/tomakehurst/wiremock/pull/199#issuecomment-66857453.

@tomakehurst
Copy link
Member

Closing as #201 adds this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants