Closed
Description
Since the 4.5 release, the RFC2136 plugin raises an exception when performing unauthenticated updates:
Submit-ChallengeValidation : Exception calling "Replace" with "2" argument(s): "String cannot be of zero length.
Parameter name: oldValue"
At C:\Program Files\WindowsPowerShell\Modules\Posh-ACME\4.5.0\Public\New-PACertificate.ps1:218 char:9
+ Submit-ChallengeValidation
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Submit-ChallengeValidation], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException,Submit-ChallengeValidation
This appears to be due to line 298 in the plugin module which was introduced in #308:
Write-Debug "Sending the following to nsupdate:`n$(($cmds -join "`n").Replace($TsigKeyValue,'************'))"
This line needs to take in to account that $TsigKeyValue
may not be set. I have successfully made this work locally by modifying as below:
if (-not $TsigKeyValue) {
Write-Debug "Sending the following to nsupdate:`n$($cmds -join "`n")"
} else {
Write-Debug "Sending the following to nsupdate:`n$(($cmds -join "`n").Replace($TsigKeyValue,'************'))"
}