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 動作。