Skip to content

Commit c5e65a4

Browse files
authored
DSC_WebSite: Change CertificateStoreName value in the schema (#641)
1 parent 04d3bd3 commit c5e65a4

File tree

9 files changed

+26
-21
lines changed

9 files changed

+26
-21
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)
1919
- IisMimeTypeMapping
2020
- Set default for Ensure property to Present.
2121

22+
### Fixed
23+
24+
- WebAdministrationDsc
25+
- Fixed CertificateStoreName default value from `MY` to `My` ([issue #642](https://github.com/dsccommunity/WebAdministrationDsc/issues/542))
26+
2227
## [4.2.0] - 2024-08-26
2328

2429
### Removed

source/DSCResources/DSC_WebSite/DSC_WebSite.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ function ConvertTo-CimBinding
13101310
}
13111311

13121312
$cimProperties.Add('CertificateThumbprint', [String]$binding.certificateHash)
1313-
$cimProperties.Add('CertificateStoreName', [String]$binding.certificateStoreName)
1313+
$cimProperties.Add('CertificateStoreName', [String]($binding.certificateStoreName) -creplace ('^MY$','My'))
13141314

13151315
New-CimInstance -ClassName $cimClassName `
13161316
-Namespace $cimNamespace `
@@ -1460,14 +1460,14 @@ function ConvertTo-WebBinding
14601460

14611461
if ([String]::IsNullOrEmpty($binding.CertificateStoreName))
14621462
{
1463-
$certificateStoreName = 'MY'
1463+
$certificateStoreName = 'My'
14641464
Write-Verbose -Message `
14651465
($script:localizedData.VerboseConvertToWebBindingDefaultCertificateStoreName `
14661466
-f $certificateStoreName)
14671467
}
14681468
else
14691469
{
1470-
$certificateStoreName = $binding.CertificateStoreName
1470+
$certificateStoreName = $binding.CertificateStoreName -creplace ('^MY$','My')
14711471
}
14721472

14731473
$certificateHash = $null

source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateSubject.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Configuration Sample_WebSite_NewWebsite_UsingCertificateSubject
7979
Protocol = 'HTTPS'
8080
Port = 8444
8181
CertificateSubject = 'CN=CertificateSubject'
82-
CertificateStoreName = 'MY'
82+
CertificateStoreName = 'My'
8383
}
8484
)
8585
DependsOn = '[File]WebContent'

source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateThumbprint.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Configuration Sample_WebSite_NewWebsite_UsingCertificateThumbprint
8888
Protocol = 'HTTPS'
8989
Port = 8444
9090
CertificateThumbprint = 'DEDDD963B28095837F558FE14DA1FDEFB7FA9DA7'
91-
CertificateStoreName = 'MY'
91+
CertificateStoreName = 'My'
9292
}
9393
)
9494
DependsOn = '[File]WebContent'

source/Examples/Resources/WebSite/Sample_WebSite_WithSSLFlags.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ configuration Sample_WebSite_WithSSLFlags
7676
{
7777
Protocol = 'https'
7878
Port = '443'
79-
CertificateStoreName = 'MY'
79+
CertificateStoreName = 'My'
8080
CertificateThumbprint = 'BB84DE3EC423DDDE90C08AB3C5A828692089493C'
8181
HostName = $WebSiteName
8282
IPAddress = '*'

tests/Integration/DSC_SslSettings.config.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
HTTPSProtocol = 'https'
1212
HTTPSPort = '443'
1313
HTTPSHostname = 'https.website'
14-
CertificateStoreName = 'MY'
14+
CertificateStoreName = 'My'
1515
SslFlags = '1'
1616
Bindings = @('Ssl')
1717
}

tests/Integration/DSC_WebApplication.config.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
HTTPSProtocol = 'https'
2020
HTTPSPort = '443'
2121
HTTPSHostname = 'https.website'
22-
CertificateStoreName = 'MY'
22+
CertificateStoreName = 'My'
2323
SslFlags = '1'
2424
WebApplicationSslFlags = @('Ssl')
2525
EnabledProtocols = @('http', 'net.tcp')

tests/Integration/DSC_WebSite.config.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
HTTPSPort = '443'
2828
HTTPSPort2 = '8444'
2929
HTTPSHostname = 'https.website'
30-
CertificateStoreName = 'MY'
30+
CertificateStoreName = 'My'
3131
SslFlags = '1'
3232
LogFieldName1 = 'CustomField1'
3333
SourceName1 = 'Accept-Encoding'

tests/Unit/DSC_Website.Tests.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,7 @@ try
22492249
bindingInformation = '127.0.0.1:443:MockHostName'
22502250
protocol = 'https'
22512251
certificateHash = '1D3324C6E2F7ABC794C9CB6CA426B8D0F81045CD'
2252-
certificateStoreName = 'MY'
2252+
certificateStoreName = 'My'
22532253
sslFlags = '1'
22542254
}
22552255

@@ -2276,7 +2276,7 @@ try
22762276
}
22772277

22782278
It 'should return the CertificateStoreName' {
2279-
$Result.CertificateStoreName | Should Be 'MY'
2279+
$Result.CertificateStoreName | Should BeExactly 'My'
22802280
}
22812281

22822282
It 'should return the SslFlags' {
@@ -2289,7 +2289,7 @@ try
22892289
bindingInformation = '[0:0:0:0:0:0:0:1]:443:MockHostName'
22902290
protocol = 'https'
22912291
certificateHash = '1D3324C6E2F7ABC794C9CB6CA426B8D0F81045CD'
2292-
certificateStoreName = 'MY'
2292+
certificateStoreName = 'My'
22932293
sslFlags = '1'
22942294
}
22952295

@@ -2316,7 +2316,7 @@ try
23162316
}
23172317

23182318
It 'should return the CertificateStoreName' {
2319-
$Result.CertificateStoreName | Should Be 'MY'
2319+
$Result.CertificateStoreName | Should BeExactly 'My'
23202320
}
23212321

23222322
It 'should return the SslFlags' {
@@ -2470,7 +2470,7 @@ try
24702470
-Property @{
24712471
Protocol = 'https'
24722472
CertificateThumbprint = $MockThumbprintWithLrmChar
2473-
CertificateStoreName = 'MY'
2473+
CertificateStoreName = 'My'
24742474
} -ClientOnly
24752475
)
24762476

@@ -2617,7 +2617,7 @@ try
26172617
-Property @{
26182618
Protocol = 'https'
26192619
CertificateSubject = 'TestCertificate'
2620-
CertificateStoreName = 'MY'
2620+
CertificateStoreName = 'My'
26212621
} -ClientOnly
26222622
)
26232623

@@ -2651,7 +2651,7 @@ try
26512651

26522652
It 'should set CertificateStoreName to the default value' {
26532653
$Result = ConvertTo-WebBinding -InputObject $MockBindingInfo
2654-
$Result.certificateStoreName | Should Be 'MY'
2654+
$Result.certificateStoreName | Should BeExactly 'My'
26552655
}
26562656
}
26572657

@@ -3427,7 +3427,7 @@ try
34273427
Port = 443
34283428
HostName = ''
34293429
CertificateThumbprint = '1D3324C6E2F7ABC794C9CB6CA426B8D0F81045CD'
3430-
CertificateStoreName = 'MY'
3430+
CertificateStoreName = 'My'
34313431
SslFlags = 0
34323432
}
34333433
)
@@ -3437,7 +3437,7 @@ try
34373437
bindingInformation = '*:443:'
34383438
protocol = 'https'
34393439
certificateHash = 'B30F3184A831320382C61EFB0551766321FA88A5'
3440-
certificateStoreName = 'MY'
3440+
certificateStoreName = 'My'
34413441
sslFlags = '0'
34423442
}
34433443
)
@@ -3468,7 +3468,7 @@ try
34683468
Port = 443
34693469
HostName = ''
34703470
CertificateThumbprint = '1D3324C6E2F7ABC794C9CB6CA426B8D0F81045CD'
3471-
CertificateStoreName = 'MY'
3471+
CertificateStoreName = 'My'
34723472
SslFlags = 0
34733473
}
34743474
)
@@ -3507,7 +3507,7 @@ try
35073507
Port = 443
35083508
HostName = ''
35093509
CertificateThumbprint = ''
3510-
CertificateStoreName = 'MY'
3510+
CertificateStoreName = 'My'
35113511
SslFlags = 0
35123512
}
35133513
)
@@ -3814,7 +3814,7 @@ try
38143814
Port = 443
38153815
HostName = ''
38163816
CertificateThumbprint = '5846A1B276328B1A32A30150858F6383C1F30E1F'
3817-
CertificateStoreName = 'MY'
3817+
CertificateStoreName = 'My'
38183818
SslFlags = 0
38193819
}
38203820
)

0 commit comments

Comments
 (0)