Skip to content

Commit fef5529

Browse files
committed
Added support for resetting Certificates to default self-signed certificates
1 parent c665261 commit fef5529

1 file changed

Lines changed: 36 additions & 6 deletions

File tree

src/StorageGRID-Webscale.psm1

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14412,9 +14412,24 @@ function Global:Update-SgwManagementCertificate {
1441214412
}
1441314413

1441414414
$Body = @{}
14415-
$Body.serverCertificateEncoded = $ServerCertificate
14416-
$Body.caBundleEncoded = $CaBundle
14417-
$Body.privateKeyEncoded = $PrivateKey
14415+
if ($ServerCertificate) {
14416+
$Body.serverCertificateEncoded = $ServerCertificate
14417+
}
14418+
else {
14419+
$Body.serverCertificateEncoded = $null
14420+
}
14421+
if ($CaBundle) {
14422+
$Body.caBundleEncoded = $CaBundle
14423+
}
14424+
else {
14425+
$Body.caBundleEncoded = $null
14426+
}
14427+
if ($PrivateKey) {
14428+
$Body.privateKeyEncoded = $PrivateKey
14429+
}
14430+
else {
14431+
$Body.privateKeyEncoded = $null
14432+
}
1441814433

1441914434
$Body = ConvertTo-Json -InputObject $Body
1442014435

@@ -14618,9 +14633,24 @@ function Global:Update-SgwObjectCertificate {
1461814633
}
1461914634

1462014635
$Body = @{}
14621-
$Body.serverCertificateEncoded = $ServerCertificate
14622-
$Body.caBundleEncoded = $CaBundle
14623-
$Body.privateKeyEncoded = $PrivateKey
14636+
if ($ServerCertificate) {
14637+
$Body.serverCertificateEncoded = $ServerCertificate
14638+
}
14639+
else {
14640+
$Body.serverCertificateEncoded = $null
14641+
}
14642+
if ($CaBundle) {
14643+
$Body.caBundleEncoded = $CaBundle
14644+
}
14645+
else {
14646+
$Body.caBundleEncoded = $null
14647+
}
14648+
if ($PrivateKey) {
14649+
$Body.privateKeyEncoded = $PrivateKey
14650+
}
14651+
else {
14652+
$Body.privateKeyEncoded = $null
14653+
}
1462414654

1462514655
$Body = ConvertTo-Json -InputObject $Body
1462614656

0 commit comments

Comments
 (0)