Class DefaultSslStreamWrapperFactory
The default implementation of the ISslStreamWrapperFactory interface.
Implements
Inherited Members
Namespace: FubarDev.FtpServer.Authentication
Assembly: FubarDev.FtpServer.dll
Syntax
public class DefaultSslStreamWrapperFactory : ISslStreamWrapperFactory
Constructors
| Improve this Doc View SourceDefaultSslStreamWrapperFactory(Nullable<ILogger<DefaultSslStreamWrapperFactory>>)
Initializes a new instance of the DefaultSslStreamWrapperFactory class.
Declaration
public DefaultSslStreamWrapperFactory(ILogger<DefaultSslStreamWrapperFactory>? logger = default(ILogger<DefaultSslStreamWrapperFactory>? ))
Parameters
Type | Name | Description |
---|---|---|
Nullable<ILogger<DefaultSslStreamWrapperFactory>> | logger | The logger. |
Methods
| Improve this Doc View SourceCloseStreamAsync(Stream, CancellationToken)
Close the SslStream gracefully (if possible).
Declaration
public Task CloseStreamAsync(Stream sslStream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Stream | sslStream | The SslStream to close. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | The task. |
CreateSslStream(Stream, Boolean)
Create a new SslStream instance.
Declaration
protected virtual SslStream CreateSslStream(Stream unencryptedStream, bool keepOpen)
Parameters
Type | Name | Description |
---|---|---|
Stream | unencryptedStream | The stream to wrap in an SslStream instance. |
Boolean | keepOpen | Keep the inner stream open. |
Returns
Type | Description |
---|---|
SslStream | The new SslStream. |
WrapStreamAsync(Stream, Boolean, X509Certificate, CancellationToken)
Wraps the unencrypted stream in an SslStream.
Declaration
public Task<Stream> WrapStreamAsync(Stream unencryptedStream, bool keepOpen, X509Certificate certificate, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Stream | unencryptedStream | The unencrypted stream. |
Boolean | keepOpen | Keep the |
X509Certificate | certificate | The certificate to be used to authenticate as server. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<Stream> | The SslStream that wraps the |