mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-28 20:32:13 +01:00
Use dotnet default development certificate for .NET Core 2.x (#381)
This commit is contained in:
@@ -3,6 +3,9 @@ using System.Security.Cryptography.X509Certificates;
|
|||||||
|
|
||||||
namespace WireMock.HttpsCertificate
|
namespace WireMock.HttpsCertificate
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Only used for NetStandard 1.3
|
||||||
|
/// </summary>
|
||||||
internal static class PublicCertificateHelper
|
internal static class PublicCertificateHelper
|
||||||
{
|
{
|
||||||
// 1] Generate using https://www.pluralsight.com/blog/software-development/selfcert-create-a-self-signed-certificate-interactively-gui-or-programmatically-in-net
|
// 1] Generate using https://www.pluralsight.com/blog/software-development/selfcert-create-a-self-signed-certificate-interactively-gui-or-programmatically-in-net
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace WireMock.Owin
|
|||||||
PortUtils.TryExtract(url, out string protocol, out string host, out int port);
|
PortUtils.TryExtract(url, out string protocol, out string host, out int port);
|
||||||
options.Listen(System.Net.IPAddress.Any, port, listenOptions =>
|
options.Listen(System.Net.IPAddress.Any, port, listenOptions =>
|
||||||
{
|
{
|
||||||
listenOptions.UseHttps(PublicCertificateHelper.GetX509Certificate2());
|
listenOptions.UseHttps(); // PublicCertificateHelper.GetX509Certificate2()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user