Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CHttpServer/CHttpServer/DuplexPipeStreamAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CHttpServer;
internal class DuplexPipeStreamAdapter<TStream> : Stream, IDuplexPipe where TStream : Stream
{
private bool _disposed;
private readonly object _disposeLock = new object();
private readonly Lock _disposeLock = new();

public DuplexPipeStreamAdapter(TStream stream, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public override async ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> sou
_responseStream.Flush();
return new FlushResult(isCanceled: false, isCompleted: false);
}
catch (Exception ex)
catch (Exception)
{
_isCompleted = true;
ClearSegments(CollectionsMarshal.AsSpan(_segments));
Expand Down
10 changes: 8 additions & 2 deletions src/CHttpServer/CHttpServer/HttpsConnectionMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task OnConnectionAsync(CHttp2ConnectionContext context)
}

var sslDuplexPipe = CreateSslDuplexPipe(
context.Transport,
context.Transport!,
context.Features.Get<IMemoryPoolFeature>()?.MemoryPool ?? MemoryPool<byte>.Shared);
var sslStream = sslDuplexPipe.Stream;

Expand Down Expand Up @@ -252,17 +252,23 @@ public X509Certificate2? ClientCertificate
// Required for TLS Handshake feature

public TlsCipherSuite? NegotiatedCipherSuite => _sslStream.NegotiatedCipherSuite;


[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public CipherAlgorithmType CipherAlgorithm => _sslStream.CipherAlgorithm;

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public int CipherStrength => _sslStream.CipherStrength;

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public HashAlgorithmType HashAlgorithm => _sslStream.HashAlgorithm;

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public int HashStrength => _sslStream.HashStrength;

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public ExchangeAlgorithmType KeyExchangeAlgorithm => _sslStream.KeyExchangeAlgorithm;

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public int KeyExchangeStrength => _sslStream.KeyExchangeStrength;

public Task<X509Certificate2?> GetClientCertificateAsync(CancellationToken cancellationToken)
Expand Down
2 changes: 1 addition & 1 deletion src/CHttpServer/TestCHttpServerApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

public class Data
{
public string Message { get; set; }
public required string Message { get; set; }
}

[JsonSerializable(typeof(Data))]
Expand Down
3 changes: 3 additions & 0 deletions tests/CHttpServer.Tests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,17 @@ internal class TestTls : ITlsHandshakeFeature
{
public SslProtocols Protocol => SslProtocols.Tls12;

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public CipherAlgorithmType CipherAlgorithm => throw new NotImplementedException();

public int CipherStrength => throw new NotImplementedException();

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public HashAlgorithmType HashAlgorithm => throw new NotImplementedException();

public int HashStrength => throw new NotImplementedException();

[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
public ExchangeAlgorithmType KeyExchangeAlgorithm => throw new NotImplementedException();

public int KeyExchangeStrength => throw new NotImplementedException();
Expand Down
Loading