使用HttpRequestMessage发送X509证书(dnxcore50)

时间:2016-03-07 23:53:14

标签: c# asp.net .net dnx dnx50

有关如何在使用.NET Core的外部API的POST请求中包含客户端证书的任何想法,在Mac上运行?我会使用WebRequestHandler nupkg中的Microsoft.Net.Http执行此操作,但看起来它不可用 - 我正在DNXCore,Version=v5.0 error CS0246: The type or namespace name 'WebRequestHandler' could not be found

using System.Net.Http;

public class ServiceWrapper {
    public void Post() {
        var handler = new WebRequestHandler();

    }

}

依赖项,来自project.json:

"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Dapper": "1.50.0-beta8",
"Autofac": "4.0.0-rc1-177",
"Autofac.Extensions.DependencyInjection": "4.0.0-rc1-177",
"AutoMapper": "4.2.1",
"System.Xml.XmlSerializer": "4.0.11-beta-23516",
"Microsoft.AspNet.WebApi.Client": "5.2.3",
"Microsoft.Net.Http": "2.2.29",
"Microsoft.Net.Http.Client": "1.0.0-beta8-15501"
}

我的〜/ .config / nuget / nuget.config:

<configuration>
  <packageSources>
    <add key="vnext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
    <add key="Official NuGet Gallery" value="https://www.nuget.org/api/v2/" />
  </packageSources>
  <activePackageSource>
    <add key="Official NuGet Gallery" value="https://www.nuget.org/api/v2/" />
  </activePackageSource>
</configuration>

0 个答案:

没有答案