ListenOptionsHttpsExtensions.UseHttps Method

Definition

Overloads

UseHttps(ListenOptions)

Configure Kestrel to use HTTPS with the default certificate if available. This will throw if no default certificate is configured.

UseHttps(ListenOptions, HttpsConnectionAdapterOptions)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, X509Certificate2)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, String)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, StoreName, String)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, X509Certificate2, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, String, String)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, StoreName, String, Boolean)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, String, String, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use HTTPS.

UseHttps(ListenOptions)

Configure Kestrel to use HTTPS with the default certificate if available. This will throw if no default certificate is configured.

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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, HttpsConnectionAdapterOptions)

Configure Kestrel to use HTTPS.

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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

httpsOptions
HttpsConnectionAdapterOptions

Options to configure HTTPS.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

configureOptions
Action<HttpsConnectionAdapterOptions>

An action to configure options for HTTPS.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, X509Certificate2)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

serverCertificate
X509Certificate2

The X.509 certificate.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, String)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

fileName
String

The name of a certificate file, relative to the directory that contains the application content files.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, StoreName, String)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

storeName
StoreName

The certificate store to load the certificate from.

subject
String

The subject name for the certificate to load.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, X509Certificate2, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

serverCertificate
X509Certificate2

The X.509 certificate.

configureOptions
Action<HttpsConnectionAdapterOptions>

An Action to configure the HttpsConnectionAdapterOptions.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, String, String)

Configure Kestrel to use 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);
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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

fileName
String

The name of a certificate file, relative to the directory that contains the application content files.

password
String

The password required to access the X.509 certificate data.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, StoreName, String, Boolean)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

storeName
StoreName

The certificate store to load the certificate from.

subject
String

The subject name for the certificate to load.

allowInvalid
Boolean

Indicates if invalid certificates should be considered, such as self-signed certificates.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, String, String, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use 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);
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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

fileName
String

The name of a certificate file, relative to the directory that contains the application content files.

password
String

The password required to access the X.509 certificate data.

configureOptions
Action<HttpsConnectionAdapterOptions>

An Action to configure the HttpsConnectionAdapterOptions.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

storeName
StoreName

The certificate store to load the certificate from.

subject
String

The subject name for the certificate to load.

allowInvalid
Boolean

Indicates if invalid certificates should be considered, such as self-signed certificates.

location
StoreLocation

The store location to load the certificate from.

Returns

ListenOptions

The ListenOptions.

UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation, Action<HttpsConnectionAdapterOptions>)

Configure Kestrel to use 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

Parameters

listenOptions
ListenOptions

The ListenOptions to configure.

storeName
StoreName

The certificate store to load the certificate from.

subject
String

The subject name for the certificate to load.

allowInvalid
Boolean

Indicates if invalid certificates should be considered, such as self-signed certificates.

location
StoreLocation

The store location to load the certificate from.

configureOptions
Action<HttpsConnectionAdapterOptions>

An Action to configure the HttpsConnectionAdapterOptions.

Returns

ListenOptions

The ListenOptions.

Applies to