Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,14 @@ function Test-ApplicationGatewayCRUD

$probe02 = New-AzApplicationGatewayProbeConfig -Name $probe02Name -Match $match2 -Protocol Https -HostName "probe.com" -Path "/path/path.htm" -Interval 89 -Timeout 88 -UnhealthyThreshold 8

$poolSetting02 = New-AzApplicationGatewayBackendHttpSettings -Name $poolSetting02Name -Probe $probe02 -Port 443 -Protocol Https -CookieBasedAffinity Enabled -AuthenticationCertificates $authcert01
$poolSetting02 = New-AzApplicationGatewayBackendHttpSettings -Name $poolSetting02Name -Probe $probe02 -Port 443 -Protocol Https -CookieBasedAffinity Enabled -AuthenticationCertificates $authcert01 -ValidateCertChainAndExpiry $true -ValidateSni $false
Assert-Null $poolSetting02.connectionDraining
Assert-NotNull $poolSetting02.Probe

# Verify new certificate validation properties - test both true and false scenarios
Assert-AreEqual $true $poolSetting02.ValidateCertChainAndExpiry
Assert-AreEqual $false $poolSetting02.ValidateSni

# Test setting and removing connectiondraining
Set-AzApplicationGatewayConnectionDraining -BackendHttpSettings $poolSetting02 -Enabled $False -DrainTimeoutInSec 3600
$connectionDraining02 = Get-AzApplicationGatewayConnectionDraining -BackendHttpSettings $poolSetting02
Expand Down Expand Up @@ -223,7 +227,11 @@ function Test-ApplicationGatewayCRUD
Compare-ConnectionDraining $poolSetting01 $getgw.BackendHttpSettingsCollection[0]
Compare-ConnectionDraining $poolSetting02 $getgw.BackendHttpSettingsCollection[1]
Compare-WebApplicationFirewallConfiguration $firewallConfig $getgw.WebApplicationFirewallConfiguration


# Verify new certificate validation properties are preserved after creation
Assert-AreEqual $true $getgw.BackendHttpSettingsCollection[1].ValidateCertChainAndExpiry
Assert-AreEqual $false $getgw.BackendHttpSettingsCollection[1].ValidateSni

<#
Tested on Azure Portal CloudShell against a V2 gateway and got the same error that this test gets when listing gateways...
Get-AzApplicationGateway: Resource provider 'Microsoft.Network' failed to return collection response for type 'applicationGateways'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class AzureApplicationGatewayBackendHttpSettingsBase : NetworkBaseCmdlet
[Parameter(
Mandatory = false,
HelpMessage = "When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.")]
public bool? ValidateSNI { get; set; }
public bool? ValidateSni { get; set; }

[Parameter(
Mandatory = false,
Expand Down Expand Up @@ -229,14 +229,14 @@ public PSApplicationGatewayBackendHttpSettings NewObject()
backendHttpSettings.ValidateCertChainAndExpiry = true;
}

if (this.ValidateSNI.HasValue)
if (this.ValidateSni.HasValue)
{
backendHttpSettings.ValidateSNI = this.ValidateSNI.Value;
backendHttpSettings.ValidateSni = this.ValidateSni.Value;
}
else
{
// Default value is true according to the API specification
backendHttpSettings.ValidateSNI = true;
backendHttpSettings.ValidateSni = true;
}

if (this.SniName != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Upcoming Release
* Added new cmdlet for List NetworkSecurityPerimeter ServiceTags
- `Get-AzNetworkSecurityPerimeterServiceTag`
* Added properties 'DedicatedBackendConnection', 'ValidateCertChainAndExpiry', 'ValidateSNI', and 'SniName' to Application Gateway Backend HTTP Settings, as well as support for them in the following cmdlets:
* Added properties 'DedicatedBackendConnection', 'ValidateCertChainAndExpiry', 'ValidateSni', and 'SniName' to Application Gateway Backend HTTP Settings, as well as support for them in the following cmdlets:
- `New-AzApplicationGatewayBackendHttpSetting`
- `Add-AzApplicationGatewayBackendHttpSetting`
- `Set-AzApplicationGatewayBackendHttpSetting`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class PSApplicationGatewayBackendHttpSettings : PSChildResource
[Ps1Xml(Target = ViewControl.Table)]
public bool? ValidateCertChainAndExpiry { get; set; }
[Ps1Xml(Target = ViewControl.Table)]
public bool? ValidateSNI { get; set; }
public bool? ValidateSni { get; set; }
[Ps1Xml(Target = ViewControl.Table)]
public string SniName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Add-AzApplicationGatewayBackendHttpSetting -ApplicationGateway <PSApplicationGat
[-AuthenticationCertificates <PSApplicationGatewayAuthenticationCertificate[]>]
[-TrustedRootCertificate <PSApplicationGatewayTrustedRootCertificate[]>] [-PickHostNameFromBackendAddress]
[-HostName <String>] [-AffinityCookieName <String>] [-Path <String>]
[-DedicatedBackendConnection <Boolean>] [-ValidateCertChainAndExpiry <Boolean>] [-ValidateSNI <Boolean>]
[-DedicatedBackendConnection <Boolean>] [-ValidateCertChainAndExpiry <Boolean>] [-ValidateSni <Boolean>]
[-SniName <String>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```
Expand Down Expand Up @@ -327,7 +327,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ValidateSNI
### -ValidateSni
When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ New-AzApplicationGatewayBackendHttpSetting -Name <String> -Port <Int32> -Protoco
[-TrustedRootCertificate <PSApplicationGatewayTrustedRootCertificate[]>] [-PickHostNameFromBackendAddress]
[-HostName <String>] [-AffinityCookieName <String>] [-Path <String>]
[-DedicatedBackendConnection <Boolean>] [-ValidateCertChainAndExpiry <Boolean>]
[-ValidateSNI <Boolean>]
[-ValidateSni <Boolean>]
[-SniName <String>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```
Expand Down Expand Up @@ -312,7 +312,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ValidateSNI
### -ValidateSni
When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Set-AzApplicationGatewayBackendHttpSetting -ApplicationGateway <PSApplicationGat
[-TrustedRootCertificate <PSApplicationGatewayTrustedRootCertificate[]>] [-PickHostNameFromBackendAddress]
[-HostName <String>] [-AffinityCookieName <String>] [-Path <String>]
[-DedicatedBackendConnection <Boolean>] [-ValidateCertChainAndExpiry <Boolean>]
[-ValidateSNI <Boolean>]
[-ValidateSni <Boolean>]
[-SniName <String>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```
Expand Down Expand Up @@ -330,7 +330,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ValidateSNI
### -ValidateSni
When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.

```yaml
Expand Down
Loading