Skip to content

Commit 302a3ba

Browse files
authored
Merge pull request #56 from ladeak/tlsfeature_obsolete
Adding Obsolete attribute on the properties of ITlsHandshakeFeature
2 parents 2b8bd0e + 2315d2f commit 302a3ba

5 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/CHttpServer/CHttpServer/DuplexPipeStreamAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace CHttpServer;
77
internal class DuplexPipeStreamAdapter<TStream> : Stream, IDuplexPipe where TStream : Stream
88
{
99
private bool _disposed;
10-
private readonly object _disposeLock = new object();
10+
private readonly Lock _disposeLock = new();
1111

1212
public DuplexPipeStreamAdapter(TStream stream, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions)
1313
{

src/CHttpServer/CHttpServer/Http3/Http3FramingStreamWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public override async ValueTask<FlushResult> WriteAsync(ReadOnlyMemory<byte> sou
154154
_responseStream.Flush();
155155
return new FlushResult(isCanceled: false, isCompleted: false);
156156
}
157-
catch (Exception ex)
157+
catch (Exception)
158158
{
159159
_isCompleted = true;
160160
ClearSegments(CollectionsMarshal.AsSpan(_segments));

src/CHttpServer/CHttpServer/HttpsConnectionMiddleware.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public async Task OnConnectionAsync(CHttp2ConnectionContext context)
5454
}
5555

5656
var sslDuplexPipe = CreateSslDuplexPipe(
57-
context.Transport,
57+
context.Transport!,
5858
context.Features.Get<IMemoryPoolFeature>()?.MemoryPool ?? MemoryPool<byte>.Shared);
5959
var sslStream = sslDuplexPipe.Stream;
6060

@@ -252,17 +252,23 @@ public X509Certificate2? ClientCertificate
252252
// Required for TLS Handshake feature
253253

254254
public TlsCipherSuite? NegotiatedCipherSuite => _sslStream.NegotiatedCipherSuite;
255-
255+
256+
[Obsolete("Obsolete by BCL, use NegotiatedCipherSuite instead.")]
256257
public CipherAlgorithmType CipherAlgorithm => _sslStream.CipherAlgorithm;
257258

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

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

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

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

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

268274
public Task<X509Certificate2?> GetClientCertificateAsync(CancellationToken cancellationToken)

src/CHttpServer/TestCHttpServerApplication/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
public class Data
6060
{
61-
public string Message { get; set; }
61+
public required string Message { get; set; }
6262
}
6363

6464
[JsonSerializable(typeof(Data))]

tests/CHttpServer.Tests/TestBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,17 @@ internal class TestTls : ITlsHandshakeFeature
116116
{
117117
public SslProtocols Protocol => SslProtocols.Tls12;
118118

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

121122
public int CipherStrength => throw new NotImplementedException();
122123

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

125127
public int HashStrength => throw new NotImplementedException();
126128

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

129132
public int KeyExchangeStrength => throw new NotImplementedException();

0 commit comments

Comments
 (0)