diff --git a/samples/SampleApp/Startup.cs b/samples/SampleApp/Startup.cs index c9a27b42ff..2f18d72aed 100644 --- a/samples/SampleApp/Startup.cs +++ b/samples/SampleApp/Startup.cs @@ -5,6 +5,7 @@ using System; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.Extensions.Logging; +using Microsoft.Dnx.Runtime; #if DNX451 using System.IO; @@ -16,7 +17,7 @@ namespace SampleApp { public class Startup { - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IApplicationEnvironment env) { loggerFactory.MinimumLevel = LogLevel.Debug; @@ -24,12 +25,12 @@ namespace SampleApp #if DNX451 var testCertPath = Path.Combine( - Environment.CurrentDirectory, - @"../../test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.cer"); + env.ApplicationBasePath, + @"../../test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.pfx"); if (File.Exists(testCertPath)) { - app.UseKestrelHttps(new X509Certificate2(testCertPath)); + app.UseKestrelHttps(new X509Certificate2(testCertPath, "testPassword")); } else { diff --git a/test/Microsoft.AspNet.Server.KestrelTests/HttpsConnectionFilterTests.cs b/test/Microsoft.AspNet.Server.KestrelTests/HttpsConnectionFilterTests.cs index 4a824be407..48167e7e68 100644 --- a/test/Microsoft.AspNet.Server.KestrelTests/HttpsConnectionFilterTests.cs +++ b/test/Microsoft.AspNet.Server.KestrelTests/HttpsConnectionFilterTests.cs @@ -49,7 +49,9 @@ namespace Microsoft.AspNet.Server.KestrelTests var sereverAddress = "https://localhost:54321/"; var serviceContext = new TestServiceContext() { - ConnectionFilter = new HttpsConnectionFilter(new X509Certificate2(@"TestResources/testCert.cer"), new NoOpConnectionFilter()) + ConnectionFilter = new HttpsConnectionFilter( + new X509Certificate2(@"TestResources/testCert.pfx", "testPassword"), + new NoOpConnectionFilter()) }; using (var server = new TestServer(App, serviceContext, sereverAddress)) diff --git a/test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.cer b/test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.cer deleted file mode 100644 index 75b57442b0..0000000000 Binary files a/test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.cer and /dev/null differ diff --git a/test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.pfx b/test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.pfx new file mode 100644 index 0000000000..7118908c2d Binary files /dev/null and b/test/Microsoft.AspNet.Server.KestrelTests/TestResources/testCert.pfx differ