ListenOptionsHttpsExtensions.UseHttps 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
UseHttps(ListenOptions)
配置 Kestrel 以将 HTTPS 与默认证书一起使用(如果可用)。 如果未配置默认证书,则会引发此错误。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
返回
适用于
UseHttps(ListenOptions, HttpsConnectionAdapterOptions)
将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, Microsoft::AspNetCore::Server::Kestrel::Https::HttpsConnectionAdapterOptions ^ httpsOptions);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions httpsOptions);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, httpsOptions As HttpsConnectionAdapterOptions) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- httpsOptions
- HttpsConnectionAdapterOptions
用于配置 HTTPS 的选项。
返回
适用于
UseHttps(ListenOptions, TlsHandshakeCallbackOptions)
将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, Microsoft.AspNetCore.Server.Kestrel.Https.TlsHandshakeCallbackOptions callbackOptions);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * Microsoft.AspNetCore.Server.Kestrel.Https.TlsHandshakeCallbackOptions -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, callbackOptions As TlsHandshakeCallbackOptions) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- callbackOptions
- TlsHandshakeCallbackOptions
每个连接回调的选项。
返回
适用于
UseHttps(ListenOptions, Action<HttpsConnectionAdapterOptions>)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, Action<Microsoft::AspNetCore::Server::Kestrel::Https::HttpsConnectionAdapterOptions ^> ^ configureOptions);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> configureOptions);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, configureOptions As Action(Of HttpsConnectionAdapterOptions)) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- configureOptions
- Action<HttpsConnectionAdapterOptions>
用于配置 HTTPS 选项的操作。
返回
适用于
UseHttps(ListenOptions, X509Certificate2)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ serverCertificate);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Security.Cryptography.X509Certificates.X509Certificate2 serverCertificate);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Security.Cryptography.X509Certificates.X509Certificate2 -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, serverCertificate As X509Certificate2) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- serverCertificate
- X509Certificate2
X.509 证书。
返回
适用于
UseHttps(ListenOptions, String)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::String ^ fileName);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, string fileName);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * string -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, fileName As String) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- fileName
- String
相对于包含应用程序内容文件的目录的证书文件的名称。
返回
适用于
UseHttps(ListenOptions, ServerOptionsSelectionCallback, Object)
将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Net::Security::ServerOptionsSelectionCallback ^ serverOptionsSelectionCallback, System::Object ^ state);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Net.Security.ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Net.Security.ServerOptionsSelectionCallback * obj -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, serverOptionsSelectionCallback As ServerOptionsSelectionCallback, state As Object) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- serverOptionsSelectionCallback
- ServerOptionsSelectionCallback
用于配置 HTTPS 选项的回调。
- state
- Object
的状态 serverOptionsSelectionCallback
。
返回
适用于
UseHttps(ListenOptions, StoreName, String)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Security::Cryptography::X509Certificates::StoreName storeName, System::String ^ subject);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Security.Cryptography.X509Certificates.StoreName storeName, string subject);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Security.Cryptography.X509Certificates.StoreName * string -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, storeName As StoreName, subject As String) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- storeName
- StoreName
要从中加载证书的证书存储。
- subject
- String
要加载的证书的使用者名称。
返回
适用于
UseHttps(ListenOptions, X509Certificate2, Action<HttpsConnectionAdapterOptions>)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ serverCertificate, Action<Microsoft::AspNetCore::Server::Kestrel::Https::HttpsConnectionAdapterOptions ^> ^ configureOptions);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Security.Cryptography.X509Certificates.X509Certificate2 serverCertificate, Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> configureOptions);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Security.Cryptography.X509Certificates.X509Certificate2 * Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, serverCertificate As X509Certificate2, configureOptions As Action(Of HttpsConnectionAdapterOptions)) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- serverCertificate
- X509Certificate2
X.509 证书。
- configureOptions
- Action<HttpsConnectionAdapterOptions>
用于配置 的操作 HttpsConnectionAdapterOptions。
返回
适用于
UseHttps(ListenOptions, String, String)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::String ^ fileName, System::String ^ password);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, string fileName, string password);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, string fileName, string? password);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * string * string -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, fileName As String, password As String) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- fileName
- String
相对于包含应用程序内容文件的目录的证书文件的名称。
- password
- String
访问 X.509 证书数据所需的密码。
返回
适用于
UseHttps(ListenOptions, ServerOptionsSelectionCallback, Object, TimeSpan)
将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Net::Security::ServerOptionsSelectionCallback ^ serverOptionsSelectionCallback, System::Object ^ state, TimeSpan handshakeTimeout);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Net.Security.ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state, TimeSpan handshakeTimeout);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Net.Security.ServerOptionsSelectionCallback * obj * TimeSpan -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, serverOptionsSelectionCallback As ServerOptionsSelectionCallback, state As Object, handshakeTimeout As TimeSpan) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- serverOptionsSelectionCallback
- ServerOptionsSelectionCallback
用于配置 HTTPS 选项的回调。
- state
- Object
的状态 serverOptionsSelectionCallback
。
- handshakeTimeout
- TimeSpan
指定 TLS/SSL 握手所允许的最长时间。 这必须是正和有限的。
返回
适用于
UseHttps(ListenOptions, StoreName, String, Boolean)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Security::Cryptography::X509Certificates::StoreName storeName, System::String ^ subject, bool allowInvalid);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Security.Cryptography.X509Certificates.StoreName storeName, string subject, bool allowInvalid);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Security.Cryptography.X509Certificates.StoreName * string * bool -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, storeName As StoreName, subject As String, allowInvalid As Boolean) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- storeName
- StoreName
要从中加载证书的证书存储。
- subject
- String
要加载的证书的使用者名称。
- allowInvalid
- Boolean
指示是否应考虑无效证书,例如自签名证书。
返回
适用于
UseHttps(ListenOptions, String, String, Action<HttpsConnectionAdapterOptions>)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::String ^ fileName, System::String ^ password, Action<Microsoft::AspNetCore::Server::Kestrel::Https::HttpsConnectionAdapterOptions ^> ^ configureOptions);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, string fileName, string password, Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> configureOptions);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, string fileName, string? password, Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> configureOptions);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * string * string * Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, fileName As String, password As String, configureOptions As Action(Of HttpsConnectionAdapterOptions)) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- fileName
- String
相对于包含应用程序内容文件的目录的证书文件的名称。
- password
- String
访问 X.509 证书数据所需的密码。
- configureOptions
- Action<HttpsConnectionAdapterOptions>
用于配置 的操作 HttpsConnectionAdapterOptions。
返回
适用于
UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Security::Cryptography::X509Certificates::StoreName storeName, System::String ^ subject, bool allowInvalid, System::Security::Cryptography::X509Certificates::StoreLocation location);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Security.Cryptography.X509Certificates.StoreName storeName, string subject, bool allowInvalid, System.Security.Cryptography.X509Certificates.StoreLocation location);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Security.Cryptography.X509Certificates.StoreName * string * bool * System.Security.Cryptography.X509Certificates.StoreLocation -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, storeName As StoreName, subject As String, allowInvalid As Boolean, location As StoreLocation) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- storeName
- StoreName
要从中加载证书的证书存储。
- subject
- String
要加载的证书的使用者名称。
- allowInvalid
- Boolean
指示是否应考虑无效证书,例如自签名证书。
- location
- StoreLocation
要从中加载证书的存储位置。
返回
适用于
UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation, Action<HttpsConnectionAdapterOptions>)
将 Kestrel 配置为使用 HTTPS。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ UseHttps(Microsoft::AspNetCore::Server::Kestrel::Core::ListenOptions ^ listenOptions, System::Security::Cryptography::X509Certificates::StoreName storeName, System::String ^ subject, bool allowInvalid, System::Security::Cryptography::X509Certificates::StoreLocation location, Action<Microsoft::AspNetCore::Server::Kestrel::Https::HttpsConnectionAdapterOptions ^> ^ configureOptions);
public static Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions UseHttps (this Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions listenOptions, System.Security.Cryptography.X509Certificates.StoreName storeName, string subject, bool allowInvalid, System.Security.Cryptography.X509Certificates.StoreLocation location, Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> configureOptions);
static member UseHttps : Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions * System.Security.Cryptography.X509Certificates.StoreName * string * bool * System.Security.Cryptography.X509Certificates.StoreLocation * Action<Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions> -> Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions
<Extension()>
Public Function UseHttps (listenOptions As ListenOptions, storeName As StoreName, subject As String, allowInvalid As Boolean, location As StoreLocation, configureOptions As Action(Of HttpsConnectionAdapterOptions)) As ListenOptions
参数
- listenOptions
- ListenOptions
要配置的 ListenOptions。
- storeName
- StoreName
要从中加载证书的证书存储。
- subject
- String
要加载的证书的使用者名称。
- allowInvalid
- Boolean
指示是否应考虑无效证书,例如自签名证书。
- location
- StoreLocation
要从中加载证书的存储位置。
- configureOptions
- Action<HttpsConnectionAdapterOptions>
用于配置 的操作 HttpsConnectionAdapterOptions。