Skip to content

Commit 8dbb597

Browse files
committed
Fixed several issues in updating certificates
1 parent e861b51 commit 8dbb597

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

src/StorageGRID-Webscale.psm1

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14315,7 +14315,7 @@ New-Alias -Name Replace-SgwManagementCertificate -Value Update-SgwManagementCert
1431514315
Path to certficate private key in PEM-encoding; required if serverCertificateEncoded is not empty.
1431614316
#>
1431714317
function Global:Update-SgwManagementCertificate {
14318-
[CmdletBinding(DefaultParameterSetName="String")]
14318+
[CmdletBinding(DefaultParameterSetName="Path")]
1431914319

1432014320
PARAM (
1432114321
[parameter(Mandatory = $False,
@@ -14333,7 +14333,7 @@ function Global:Update-SgwManagementCertificate {
1433314333
Position = 2,
1433414334
ValueFromPipelineByPropertyName = $True,
1433514335
ParameterSetName = "Path",
14336-
HelpMessage = "Path to X.509 server certificate in PEM-encoding; omit or null if using default certificates.")][System.IO.FileInfo]$ServerCertificatePath,
14336+
HelpMessage = "Path to X.509 server certificate in PEM-encoding; omit or null if using default certificates.")][Alias("CertFile")][SString]$ServerCertificatePath,
1433714337
[parameter(Mandatory = $False,
1433814338
Position = 3,
1433914339
ValueFromPipelineByPropertyName = $True,
@@ -14343,7 +14343,7 @@ function Global:Update-SgwManagementCertificate {
1434314343
Position = 4,
1434414344
ValueFromPipelineByPropertyName = $True,
1434514345
ParameterSetName = "Path",
14346-
HelpMessage = "Path to intermediate CA certificate bundle in concatenated PEM-encoding; omit or null when there is no intermediate CA.")][System.IO.FileInfo]$CaBundlePath,
14346+
HelpMessage = "Path to intermediate CA certificate bundle in concatenated PEM-encoding; omit or null when there is no intermediate CA.")][Alias("FullChainFile")][String]$CaBundlePath,
1434714347
[parameter(Mandatory = $False,
1434814348
Position = 5,
1434914349
ValueFromPipelineByPropertyName = $True,
@@ -14353,7 +14353,7 @@ function Global:Update-SgwManagementCertificate {
1435314353
Position = 6,
1435414354
ValueFromPipelineByPropertyName = $True,
1435514355
ParameterSetName = "Path",
14356-
HelpMessage = "Path to certficate private key in PEM-encoding; required if serverCertificateEncoded is not empty.")][System.IO.FileInfo]$PrivateKeyPath
14356+
HelpMessage = "Path to certficate private key in PEM-encoding; required if serverCertificateEncoded is not empty.")][Alias("KeyFile")][String]$PrivateKeyPath
1435714357
)
1435814358

1435914359
Begin {
@@ -14385,7 +14385,7 @@ function Global:Update-SgwManagementCertificate {
1438514385
$Method = "POST"
1438614386

1438714387
if ($ServerCertificatePath) {
14388-
if ($ServerCertificatePath.Exists) {
14388+
if ([System.IO.FileInfo]::new($ServerCertificatePath).Exists) {
1438914389
$ServerCertificate = Get-Content -Path $ServerCertificatePath
1439014390
}
1439114391
else {
@@ -14394,7 +14394,7 @@ function Global:Update-SgwManagementCertificate {
1439414394
}
1439514395

1439614396
if ($CaBundlePath) {
14397-
if ($CaBundlePath.Exists) {
14397+
if ([System.IO.FileInfo]::new($CaBundlePath).Exists) {
1439814398
$CaBundle = Get-Content -Path $CaBundlePath
1439914399
}
1440014400
else {
@@ -14403,7 +14403,7 @@ function Global:Update-SgwManagementCertificate {
1440314403
}
1440414404

1440514405
if ($PrivateKeyPath) {
14406-
if ($PrivateKeyPath.Exists) {
14406+
if ([System.IO.FileInfo]::new($PrivateKeyPath).Exists) {
1440714407
$PrivateKey = Get-Content -Path $PrivateKeyPath
1440814408
}
1440914409
else {
@@ -14517,7 +14517,7 @@ New-Alias -Name Replace-SgwObjectCertificate -Value Update-SgwObjectCertificate
1451714517
Path to certficate private key in PEM-encoding; required if serverCertificateEncoded is not empty.
1451814518
#>
1451914519
function Global:Update-SgwObjectCertificate {
14520-
[CmdletBinding(DefaultParameterSetName="String")]
14520+
[CmdletBinding(DefaultParameterSetName="Path")]
1452114521

1452214522
PARAM (
1452314523
[parameter(Mandatory = $False,
@@ -14535,7 +14535,7 @@ function Global:Update-SgwObjectCertificate {
1453514535
Position = 2,
1453614536
ValueFromPipelineByPropertyName = $True,
1453714537
ParameterSetName = "Path",
14538-
HelpMessage = "Path to X.509 server certificate in PEM-encoding; omit or null if using default certificates.")][System.IO.FileInfo]$ServerCertificatePath,
14538+
HelpMessage = "Path to X.509 server certificate in PEM-encoding; omit or null if using default certificates.")][Alias("CertFile")][String]$ServerCertificatePath,
1453914539
[parameter(Mandatory = $False,
1454014540
Position = 3,
1454114541
ValueFromPipelineByPropertyName = $True,
@@ -14545,7 +14545,7 @@ function Global:Update-SgwObjectCertificate {
1454514545
Position = 4,
1454614546
ValueFromPipelineByPropertyName = $True,
1454714547
ParameterSetName = "Path",
14548-
HelpMessage = "Path to intermediate CA certificate bundle in concatenated PEM-encoding; omit or null when there is no intermediate CA.")][System.IO.FileInfo]$CaBundlePath,
14548+
HelpMessage = "Path to intermediate CA certificate bundle in concatenated PEM-encoding; omit or null when there is no intermediate CA.")][Alias("FullChainFile")][String]$CaBundlePath,
1454914549
[parameter(Mandatory = $False,
1455014550
Position = 5,
1455114551
ValueFromPipelineByPropertyName = $True,
@@ -14555,7 +14555,7 @@ function Global:Update-SgwObjectCertificate {
1455514555
Position = 6,
1455614556
ValueFromPipelineByPropertyName = $True,
1455714557
ParameterSetName = "Path",
14558-
HelpMessage = "Path to certficate private key in PEM-encoding; required if serverCertificateEncoded is not empty.")][System.IO.FileInfo]$PrivateKeyPath
14558+
HelpMessage = "Path to certficate private key in PEM-encoding; required if serverCertificateEncoded is not empty.")][Alias("KeyFile")][String]$PrivateKeyPath
1455914559
)
1456014560

1456114561
Begin {
@@ -14587,7 +14587,7 @@ function Global:Update-SgwObjectCertificate {
1458714587
$Method = "POST"
1458814588

1458914589
if ($ServerCertificatePath) {
14590-
if ($ServerCertificatePath.Exists) {
14590+
if ([System.IO.FileInfo]::new($ServerCertificatePath).Exists) {
1459114591
$ServerCertificate = Get-Content -Path $ServerCertificatePath
1459214592
}
1459314593
else {
@@ -14596,7 +14596,7 @@ function Global:Update-SgwObjectCertificate {
1459614596
}
1459714597

1459814598
if ($CaBundlePath) {
14599-
if ($CaBundlePath.Exists) {
14599+
if ([System.IO.FileInfo]::new($CaBundlePath).Exists) {
1460014600
$CaBundle = Get-Content -Path $CaBundlePath
1460114601
}
1460214602
else {
@@ -14605,7 +14605,7 @@ function Global:Update-SgwObjectCertificate {
1460514605
}
1460614606

1460714607
if ($PrivateKeyPath) {
14608-
if ($PrivateKeyPath.Exists) {
14608+
if ([System.IO.FileInfo]::new($PrivateKeyPath).Exists) {
1460914609
$PrivateKey = Get-Content -Path $PrivateKeyPath
1461014610
}
1461114611
else {

0 commit comments

Comments
 (0)