* win_iis_webbinding: Fix bug with ipaddress * returning multiple bindings
instead of only the ones defined as *. Address possible future issues around
hostheader * by just disallowing it. Resolves 25473. Added new test for
this case.
Removed all validation for https binding collisions due to difficulty in
validating all cases in which they could or could not collide. As a
result, also removed return values relating to certificate data.
Updated testing and docs appropriately
* win_iis_webbinding: added break to remove binding loops
# 2k8r2 throws this error when you run get-webbinding with no bindings in iis
If(-not$_.Exception.Message.CompareTo('Cannot process argument because the value of argument "obj" is null. Change the value of argument "obj" to a non-null value'))
If(-not$_.Exception.Message.CompareTo('Cannot process argument because the value of argument "obj" is null. Change the value of argument "obj" to a non-null value'))
{
{
Throw$_.Exception.Message
Throw$_.Exception.Message
}
}
}
Else{return}
}
Else
{
Try{
Get-WebBinding@bind_search_splat
}
Catch{
If(-not$_.Exception.Message.CompareTo('Cannot process argument because the value of argument "obj" is null. Change the value of argument "obj" to a non-null value'))
{
Throw$_.Exception.Message
}
}
}
}
}
FunctionGet-CertificateSubjects{
Foreach($bindingin$site_bindings)
Param(
[string]$CertPath
)
If(-Not(Test-Path$CertPath))
{
{
Fail-Json-obj$result-message"Unable to locate certificate at $CertPath"
Fail-Json-obj$result-message"A conflicting binding has been found on the same ip $ip and port $port. To continue, you will either have to remove the offending binding or enable sni"
Fail-Json-obj$result-message"A conflicting binding has been found on the same ip $ip and port $port. To continue you will need to remove the existing binding or assign a new IP or Port to this one"
}
}
}
# add binding. this creates the binding, but does not apply a certificate to it.
# add binding. this creates the binding, but does not apply a certificate to it.
# 2k8r2 throws this error when you run get-webbinding with no bindings in iis
If(-not$_.Exception.Message.CompareTo('Cannot process argument because the value of argument "obj" is null. Change the value of argument "obj" to a non-null value'))
If(-not$_.Exception.Message.CompareTo('Cannot process argument because the value of argument "obj" is null. Change the value of argument "obj" to a non-null value'))
{
{
Throw$_.Exception.Message
Throw$_.Exception.Message
}
}
Else{return}
}
}
}
Else
Foreach ($bindingin$site_bindings)
{
{
Try{
$splits=$binding.bindingInformation-split':'
Get-WebBinding@bind_search_splat
}
if(
Catch{
$args[0].protocol-eq$binding.protocol-and
If(-not$_.Exception.Message.CompareTo('Cannot process argument because the value of argument "obj" is null. Change the value of argument "obj" to a non-null value'))