diff --git a/Settings.md b/Settings.md index d64f6bb..ce02f7a 100644 --- a/Settings.md +++ b/Settings.md @@ -19,6 +19,41 @@ Watch the static mapping files + folder for changes when running. ### AllowCSharpCodeMatcher Allow the usage of CSharpCodeMatcher, default is not allowed because it can be dangerous to execute all C# code. +### CertificateSettings +By default, the .NETStandard version from WireMock.Net can use the default .NET self-signed development certificate. See [HTTPS-SSL](https://github.com/WireMock-Net/WireMock.Net/wiki/Using-HTTPS-%28SSL%29#net-standard--net-core) for more info. + +However, it's also possible to use your own certificate, which can use defined in the Certificate Store or in a `.pfx` file. + +To configure this you need to define the correct values for the `CertificateSettings`. See example below: +``` c# +var server = WireMockServer.Start(new WireMockServerSettings +{ + Urls = new[] { "https://localhost:8443" }, + CertificateSettings = new WireMockCertificateSettings + { + X509StoreName = "My", + X509StoreLocation = "CurrentUser", + X509StoreThumbprintOrSubjectName = "FE16586076A8B3F3E2F1466803A6C4C7CA35455B" // This can be a Thumbprint, SubjectName or null + + // X509CertificateFilePath = "example.pfx", + // X509CertificatePassword = "wiremock" + } + +}); +``` + +Where +* `X509StoreName` = The Certificate StoreName. One of: AddressBook, AuthRoot, CertificateAuthority, My, Root, TrustedPeople, TrustedPublisher. +* `X509StoreLocation` = The Certificate StoreLocation. Can be CurrentUser or LocalMachine. +* `X509StoreThumbprintOrSubjectName` = This can be the Certifcate Thumbprint, Certifcate SubjectName or null. If it's null, the first match on the hostname Certicate is used. +* `X509CertificateFilePath` = The full path to the X509Certificate2 `.pfx` file +* `X509CertificatePassword` = The password for the X509Certificate2 `.pfx` file + +Note that: +- X509StoreName and X509StoreLocation should be defined +- OR +- X509CertificateFilePath and X509CertificatePassword should be defined + ### ProxyAndRecordSettings You can enable ProxyAndRecord functionality by defining the *ProxyAndRecordSettings* and by specifying an Url. See code example below. ```c#