Skip to content
Open
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
20 changes: 7 additions & 13 deletions IntegrationTests/certificatePermissiveness.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@ Describe 'certificate permissiveness' -Tag 'badssl' {
) |
% {@{u="https://$_.badssl.com"}}
) {
param($u,$cv)
try
{
$u | Save-WebFile ([System.IO.Path]::GetTempFileName())
}
catch
{
$threw = $true
$_.Exception | CoalesceExceptionMessage |
Should -Match '(certificate is invalid|Could not create)'
}
$threw | Should -Be $true
param($u)

{ $u | Save-WebFile ([System.IO.Path]::GetTempFileName()) } |
Assert-Throw |
Get-ChildException -Recurse |
Assert-Any { $_.Message -match 'certificate is invalid'} #|Could not create)' }
}
}
Context 'succeed without additional validation' {
Expand Down Expand Up @@ -67,7 +61,7 @@ Describe 'certificate permissiveness' -Tag 'badssl' {
) |
% {@{u="https://$_.badssl.com"}}
) {
param($u,$cv)
param($u)
$u | Save-WebFile ([System.IO.Path]::GetTempFileName())
}
}
Expand Down
1 change: 1 addition & 0 deletions prerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
Set-SchannelPolicy -Strict
Set-SpManagerPolicy -Strict
Import-WebModule 'https://github.com/pester/Pester/archive/4.0.8.zip' 'Pester.psd1' -PassThru
Import-WebModule 'https://github.com/alx9r/Assert/archive/7847b2dadc50f8ba0fe6b3b4c9e4dad0de47b17d.zip' -PassThru
Remove-Module BootstraPS