Skip to content

Commit 24a1f91

Browse files
authored
Use good certificate (#148)
1 parent 0714c7c commit 24a1f91

File tree

4 files changed

+30
-42
lines changed

4 files changed

+30
-42
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ The test server requires a self-signed certificate at this location: `.\lib\Pupp
1818
You can run this PowerShell script on Windows
1919

2020
```
21-
New-SelfSignedCertificate -Subject "puppeteer" -FriendlyName "Puppeteer" -CertStoreLocation "cert:\LocalMachine\My"
22-
Get-ChildItem -Path cert:\LocalMachine\my | where { $_.subject -eq "CN=puppeteer" } | Export-Certificate -FilePath .\lib\PuppeteerSharp.TestServer\testCert.cer
21+
New-SelfSignedCertificate -Subject "localhost" -FriendlyName "Puppeteer" -CertStoreLocation "cert:\CurrentUser\My"
22+
23+
Get-ChildItem -Path cert:\CurrentUSer\my | where { $_.friendlyname -eq "Puppeteer" } | Export-Certificate -FilePath C:\projects\puppeteer-sharp\lib\PuppeteerSharp.TestServer\testCert.cer
24+
2325
```
2426

2527
On MacOS, you can create an “SSL Client” certificate using the Keychain Access app and then export it to `.\lib\PuppeteerSharp.TestServer\testCert.cer`

appveyor.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 1.0.{build}
2+
branches:
3+
only:
4+
- master
5+
image: Previous Visual Studio 2017
6+
configuration: Release
7+
before_build:
8+
- ps: >-
9+
dotnet restore .\lib\PuppeteerSharp.sln
10+
11+
New-SelfSignedCertificate -Subject "localhost" -FriendlyName "Puppeteer" -CertStoreLocation "cert:\CurrentUser\My"
12+
13+
Get-ChildItem -Path cert:\CurrentUSer\my | where { $_.friendlyname -eq "Puppeteer" } | Export-Certificate -FilePath C:\projects\puppeteer-sharp\lib\PuppeteerSharp.TestServer\testCert.cer
14+
15+
build:
16+
project: .\lib\PuppeteerSharp.sln
17+
publish_nuget: true
18+
include_nuget_references: true
19+
verbosity: minimal
20+
test_script:
21+
- cmd: >-
22+
cd .\lib\PuppeteerSharp.Tests
23+
24+
dotnet test -s test.runsettings

lib/PuppeteerSharp.TestServer/wwwroot/testCert.pem

Lines changed: 0 additions & 38 deletions
This file was deleted.

lib/PuppeteerSharp.Tests/Page/GotoTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task ShouldFailWhenNavigatingToBadUrl()
3434
Assert.Contains("Cannot navigate to invalid URL", exception.Message);
3535
}
3636

37-
[Fact(Skip = "message is ERR_CERT_COMMON_NAME_INVALID instead of ERR_CERT_AUTHORITY_INVALID")]
37+
[Fact]
3838
public async Task ShouldFailWhenNavigatingToBadSSL()
3939
{
4040
Page.RequestCreated += (sender, e) => Assert.NotNull(e.Request);
@@ -45,7 +45,7 @@ public async Task ShouldFailWhenNavigatingToBadSSL()
4545
Assert.Contains("net::ERR_CERT_AUTHORITY_INVALID", exception.Message);
4646
}
4747

48-
[Fact(Skip = "message is ERR_CERT_COMMON_NAME_INVALID instead of ERR_CERT_AUTHORITY_INVALID")]
48+
[Fact]
4949
public async Task ShouldFailWhenNavigatingToBadSSLAfterRedirects()
5050
{
5151
var exception = await Assert.ThrowsAnyAsync<Exception>(async () => await Page.GoToAsync(TestConstants.HttpsPrefix + "/redirect/2.html"));

0 commit comments

Comments
 (0)