private async Task <Stream> CreateSslStream(
            IFtpHost host,
            Stream unencryptedStream)
        {
            if (host.Certificate == null)
            {
                throw new InvalidOperationException(T("No server certificate configured."));
            }

            var sslStream = await _sslStreamWrapperFactory.WrapStreamAsync(
                unencryptedStream,
                false,
                host.Certificate,
                CancellationToken.None)
                            .ConfigureAwait(false);

            return(sslStream);
        }
 /// <inheritdoc />
 public Task <Stream> WrapAsync(Stream stream, CancellationToken cancellationToken)
 {
     return(_sslStreamWrapperFactory.WrapStreamAsync(stream, false, _options.Certificate, cancellationToken));
 }