1

dnxcore50を使用してUbuntu 14で動作するように、Kestrel サーバーに https を構成しようとしています。

しかし、依存関係を追加すると:

"Microsoft.AspNet.Server.Kestrel.Https": "1.0.0-rc1-final"

そして、パッケージを復元しようとすると、次のメッセージが表示されます。

依存関係 Kestrel.Https 1.0.0-rc1-final は、フレームワーク DNXCore、バージョン = v5.0 をサポートしていません

Windows に移動して dnx451 を使用し、同じ依存関係を追加すると、うまく機能します。

しかし、 Ubuntudnxcore50を使用してKestrel.Httpsを使用できない場合、dnxcore50を使用してUbuntuでHttps を構成するにはどうすればよいですか?

4

2 に答える 2

1

これは、HTTPS バージョンの Kestrel が RC1 上の完全な .NET フレームワーク ( https://www.nuget.org/packages/Microsoft.AspNet.Server.Kestrel.Https/1.0.0-rc1-final ) のみを対象としているためです。

RC2 以降、Kestrel.Https はhttps://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNetCore.Server.Kestrel.Https/project.json#L20netstandard1.3をターゲットにします。

したがって、解決策は、RC2 がドロップするのを待つか、MyGet から出血している RC2 ビットを使用することです。

于 2016-04-07T14:19:48.810 に答える
-1

現在、Kestrel はすでに HTTPS をサポートしています。

バージョン 1.0.0 以降でサポートされているライブラリは次のとおりです。

https://www.nuget.org/packages/Microsoft.AspNetCore.Server.Kestrel.Https/

コードに実装するには、メインでasp.netコアアプリを初期化UseHttpsしてオプションとして追加します

やり方のサンプルはこちら!

    public static void Main(string[] args)
    {
        var host = new WebHostBuilder()
            .UseKestrel(options =>
            {
                // options.ThreadCount = 4;
                options.NoDelay = true;
                options.UseHttps("testCert.pfx", "testPassword");
                options.UseConnectionLogging();
            })
            .UseUrls("http://localhost:5000", "https://localhost:5001")
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseStartup<Startup>()
            .Build();

        // The following section should be used to demo sockets
        //var addresses = application.GetAddresses();
        //addresses.Clear();
        //addresses.Add("http://unix:/tmp/kestrel-test.sock");

        host.Run();
    }

以下にサンプルからのリンクもあります

https://github.com/aspnet/KestrelHttpServer/blob/dev/samples/SampleApp/Startup.cs#L37-L43

于 2016-12-14T18:12:12.440 に答える