-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Wiki: Add HTTPS usage inside Docker #517
Comments
Hello @winseros, I can surely add this to the docker wiki: https:/WireMock-Net/WireMock.Net-docker/wiki However wouldn't it be a better idea to apply this fix to the Linux docker image, so that by default the https works? (And can you describe the error when this is not applied?) |
Hello. I'm not sure if the issue is a case of I made a demo project to show the details: In short, there is a 3rd party HTTPClient library, hardcoded to work only through https (so you can't use HTTP for tests). In order to make WireMock HTTPS tests work, on |
OK. I see. I did add your information to this page: Can you verify it's correct? |
That's correct. Thank you! |
Hello @winseros ; thank you very much for researching the issue + solution. |
Greetings.
Some history. We use WireMock to run our unit tests inside
Docker
. The other day we had to mock a service whose official client library was nailed to work through HTTPS only. Trying to make an HTTPS mock through WireMock, we were surprised it worked nice onWindows
, but insideDocker
we were receiving SSL validation errors at connection time.The reasons behind the behavior - are #379, where the support of default aspnetcore development certificates was added,
and dotnet/aspnetcore#7246, that prevents default dev certificates from being trusted on
Linux
/Docker
.There is a way to make WireMock run trusted HTTPS inside
Docker
I'd like to share.Make the
localhost.conf
file of content:Note the
1.3.6.1.4.1.311.84.1.1 = DER:01
it is critical for aspnet for recognizing the cert.Generate the cert:
Grab the
localhost.pfx
andlocalhost.crt
and throw them into the target system. In case ofDocker
that would look:Profit. The system has the aspnetcore dev cert trusted.
Ideally I'd like those 4 steps to be added into the project Wiki so others won't have to spend all the time I did to find a solution.
Best regards.
The text was updated successfully, but these errors were encountered: