summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Tinus <win.acme.simple@gmail.com>2020-07-14 08:27:14 +0200
committerWouter Tinus <win.acme.simple@gmail.com>2020-07-14 08:27:14 +0200
commit180e8e315fc4747d99a13316d09fd4caea557600 (patch)
tree158998f936ae92c6f500e24ecb4b3a55ce4d1aa3
parentfbb690a222e79852304e6bba1a0672db4877599e (diff)
parent7e899163b49687dffb159172c4049a27c05f6159 (diff)
downloadletsencrypt-win-simple-180e8e315fc4747d99a13316d09fd4caea557600.zip
letsencrypt-win-simple-180e8e315fc4747d99a13316d09fd4caea557600.tar.gz
letsencrypt-win-simple-180e8e315fc4747d99a13316d09fd4caea557600.tar.bz2
Merge branch '2.1.10' of https://github.com/win-acme/win-acme into 2.1.10
-rw-r--r--dist/Scripts/ImportKemp.ps190
1 files changed, 90 insertions, 0 deletions
diff --git a/dist/Scripts/ImportKemp.ps1 b/dist/Scripts/ImportKemp.ps1
new file mode 100644
index 0000000..7804402
--- /dev/null
+++ b/dist/Scripts/ImportKemp.ps1
@@ -0,0 +1,90 @@
+<#
+.SYNOPSIS
+Imports a cert from WASC renewal into KEMP Loadmaster.
+.DESCRIPTION
+Note that this script is intended to be run via the install script plugin from WASC via the batch script wrapper. As such, we use positional parameters to avoid issues with using a dash in the cmd line.
+
+THIS SCRIPT IS INCOMPLETE AND *mostly* UNTESTED (some modifications have come in from people using it successfully)
+Proper information should be available here
+
+https://github.com/PKISharp/win-acme/wiki/Install-Script
+
+or more generally, here
+
+https://github.com/PKISharp/win-acme/wiki/Example-Scripts
+
+.PARAMETER CertName
+The exact ID of the cert to be imported.
+
+.PARAMETER PfxFile
+File name in the CertificatePath.
+
+.PARAMETER PfxPassword
+(Central Certificate Store) Password of the .pfx file.
+
+.PARAMETER KempUserName
+Username for KEMP PowerShell module
+
+.PARAMETER KempUserPass
+Password for KEMP PowerShell module
+
+.PARAMETER KempIP
+KEMP IP address
+
+.EXAMPLE
+
+./Scripts/ImportKemp.ps1 "'{RenewalId}' '{CacheFile}' '{CachePassword}' 'bal' 'pass' '10.10.10.10'"
+
+
+.NOTES
+KEMP PowerShell module installation help:
+https://support.kemptechnologies.com/hc/en-us/articles/203863385-PowerShell#MadCap_TOC_8_2
+
+Download site, Tools --> General --> LoadMaster PowerShell API Wrapper: https://kemptechnologies.com/loadmaster-documentation/
+
+#>
+
+param(
+ [Parameter(Position=0,Mandatory=$true)]
+ [string]
+ $CertName,
+
+ [Parameter(Position=1,Mandatory=$false)]
+ [string]
+ $PfxFile,
+
+ [Parameter(Position=2,Mandatory=$false)]
+ [string]
+ $PfxPassword,
+
+ [Parameter(Position=3,Mandatory=$false)]
+ [string]
+ $KempUserName,
+
+ [Parameter(Position=4,Mandatory=$false)]
+ [string]
+ $KempUserPass,
+
+ [Parameter(Position=5,Mandatory=$false)]
+ [string]
+ $KempIP
+)
+
+Import-Module Kemp.LoadBalancer.Powershell
+
+#Get-Module Kemp.LoadBalancer.Powershell
+#Test-LmServerConnection -ComputerName $KempIP -Port 443 -Verbose
+
+$password = ConvertTo-SecureString $KempUserPass -AsPlainText -Force
+$psCred = New-Object System.Management.Automation.PSCredential -ArgumentList ($KempUserName, $password)
+$arrLMConnectResult = Initialize-LmConnectionParameters -Address $KempIP -LBPort 443 -Credential $psCred
+
+#Get-Command -Module Kemp.LoadBalancer.Powershell | Out-GridView
+#(Get-TlsCertificate).Data.cert
+
+$NewTlsCertificateResult = New-TlsCertificate -Name $CertName -Password $PfxPassword -Replace -Path $PfxFile
+if($NewTlsCertificateResult.returncode -eq "422"){
+ $NewTlsCertificateResult = New-TlsCertificate -Name $CertName -Password $PfxPassword -Path $PfxFile
+}
+
+$NewTlsCertificateResult