Skip to content

Commit 85c5e03

Browse files
committed
Obsolete the older IMailService negotiated SSL/TLS properties for .NET 10
These APIs include: * SslCipherAlgorithm * SslCipherStrength * SslHashAlgorithm * SslHashStrength * SslKeyExchangeAlgorithm * SslKeyExchangeStrength The corresponding SslStream properties are marked as Obsolete in .NET 10 in favor of the NegotiatedTlsCipherSuite property. The equivalent property in MailKit is the IMailService.SslCipherSuite property.
1 parent af6ccc2 commit 85c5e03

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-0
lines changed

MailKit/IMailService.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ public interface IMailService : IDisposable
249249
/// Gets the negotiated SSL or TLS cipher algorithm once an SSL or TLS connection has been made.
250250
/// </remarks>
251251
/// <value>The negotiated SSL or TLS cipher algorithm.</value>
252+
#if NET10_0_OR_GREATER
253+
[Obsolete ("Use SslCipherSuite instead.")]
254+
#endif
252255
CipherAlgorithmType? SslCipherAlgorithm { get; }
253256

254257
/// <summary>
@@ -258,6 +261,9 @@ public interface IMailService : IDisposable
258261
/// Gets the negotiated SSL or TLS cipher algorithm strength once an SSL or TLS connection has been made.
259262
/// </remarks>
260263
/// <value>The negotiated SSL or TLS cipher algorithm strength.</value>
264+
#if NET10_0_OR_GREATER
265+
[Obsolete ("Use SslCipherSuite instead.")]
266+
#endif
261267
int? SslCipherStrength { get; }
262268

263269
/// <summary>
@@ -267,6 +273,9 @@ public interface IMailService : IDisposable
267273
/// Gets the negotiated SSL or TLS hash algorithm once an SSL or TLS connection has been made.
268274
/// </remarks>
269275
/// <value>The negotiated SSL or TLS hash algorithm.</value>
276+
#if NET10_0_OR_GREATER
277+
[Obsolete ("Use SslCipherSuite instead.")]
278+
#endif
270279
HashAlgorithmType? SslHashAlgorithm { get; }
271280

272281
/// <summary>
@@ -276,6 +285,9 @@ public interface IMailService : IDisposable
276285
/// Gets the negotiated SSL or TLS hash algorithm strength once an SSL or TLS connection has been made.
277286
/// </remarks>
278287
/// <value>The negotiated SSL or TLS hash algorithm strength.</value>
288+
#if NET10_0_OR_GREATER
289+
[Obsolete ("Use SslCipherSuite instead.")]
290+
#endif
279291
int? SslHashStrength { get; }
280292

281293
/// <summary>
@@ -285,6 +297,9 @@ public interface IMailService : IDisposable
285297
/// Gets the negotiated SSL or TLS key exchange algorithm once an SSL or TLS connection has been made.
286298
/// </remarks>
287299
/// <value>The negotiated SSL or TLS key exchange algorithm.</value>
300+
#if NET10_0_OR_GREATER
301+
[Obsolete ("Use SslCipherSuite instead.")]
302+
#endif
288303
ExchangeAlgorithmType? SslKeyExchangeAlgorithm { get; }
289304

290305
/// <summary>
@@ -294,6 +309,9 @@ public interface IMailService : IDisposable
294309
/// Gets the negotiated SSL or TLS key exchange algorithm strength once an SSL or TLS connection has been made.
295310
/// </remarks>
296311
/// <value>The negotiated SSL or TLS key exchange algorithm strength.</value>
312+
#if NET10_0_OR_GREATER
313+
[Obsolete ("Use SslCipherSuite instead.")]
314+
#endif
297315
int? SslKeyExchangeStrength { get; }
298316

299317
/// <summary>

MailKit/MailService.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ public abstract SslProtocols SslProtocol {
340340
/// Gets the negotiated SSL or TLS cipher algorithm once an SSL or TLS connection has been made.
341341
/// </remarks>
342342
/// <value>The negotiated SSL or TLS cipher algorithm.</value>
343+
#if NET10_0_OR_GREATER
344+
[Obsolete ("Use SslCipherSuite instead.")]
345+
#endif
343346
public abstract CipherAlgorithmType? SslCipherAlgorithm {
344347
get;
345348
}
@@ -351,6 +354,9 @@ public abstract CipherAlgorithmType? SslCipherAlgorithm {
351354
/// Gets the negotiated SSL or TLS cipher algorithm strength once an SSL or TLS connection has been made.
352355
/// </remarks>
353356
/// <value>The negotiated SSL or TLS cipher algorithm strength.</value>
357+
#if NET10_0_OR_GREATER
358+
[Obsolete ("Use SslCipherSuite instead.")]
359+
#endif
354360
public abstract int? SslCipherStrength {
355361
get;
356362
}
@@ -362,6 +368,9 @@ public abstract int? SslCipherStrength {
362368
/// Gets the negotiated SSL or TLS hash algorithm once an SSL or TLS connection has been made.
363369
/// </remarks>
364370
/// <value>The negotiated SSL or TLS hash algorithm.</value>
371+
#if NET10_0_OR_GREATER
372+
[Obsolete ("Use SslCipherSuite instead.")]
373+
#endif
365374
public abstract HashAlgorithmType? SslHashAlgorithm {
366375
get;
367376
}
@@ -373,6 +382,9 @@ public abstract HashAlgorithmType? SslHashAlgorithm {
373382
/// Gets the negotiated SSL or TLS hash algorithm strength once an SSL or TLS connection has been made.
374383
/// </remarks>
375384
/// <value>The negotiated SSL or TLS hash algorithm strength.</value>
385+
#if NET10_0_OR_GREATER
386+
[Obsolete ("Use SslCipherSuite instead.")]
387+
#endif
376388
public abstract int? SslHashStrength {
377389
get;
378390
}
@@ -384,6 +396,9 @@ public abstract int? SslHashStrength {
384396
/// Gets the negotiated SSL or TLS key exchange algorithm once an SSL or TLS connection has been made.
385397
/// </remarks>
386398
/// <value>The negotiated SSL or TLS key exchange algorithm.</value>
399+
#if NET10_0_OR_GREATER
400+
[Obsolete ("Use SslCipherSuite instead.")]
401+
#endif
387402
public abstract ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
388403
get;
389404
}
@@ -395,6 +410,9 @@ public abstract ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
395410
/// Gets the negotiated SSL or TLS key exchange algorithm strength once an SSL or TLS connection has been made.
396411
/// </remarks>
397412
/// <value>The negotiated SSL or TLS key exchange algorithm strength.</value>
413+
#if NET10_0_OR_GREATER
414+
[Obsolete ("Use SslCipherSuite instead.")]
415+
#endif
398416
public abstract int? SslKeyExchangeStrength {
399417
get;
400418
}

MailKit/Net/Imap/ImapClient.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,9 @@ public override SslProtocols SslProtocol {
754754
/// <code language="c#" source="Examples\ImapExamples.cs" region="SslConnectionInformation"/>
755755
/// </example>
756756
/// <value>The negotiated SSL or TLS cipher algorithm.</value>
757+
#if NET10_0_OR_GREATER
758+
[Obsolete ("Use SslCipherSuite instead.")]
759+
#endif
757760
public override CipherAlgorithmType? SslCipherAlgorithm {
758761
get {
759762
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -773,6 +776,9 @@ public override CipherAlgorithmType? SslCipherAlgorithm {
773776
/// <code language="c#" source="Examples\ImapExamples.cs" region="SslConnectionInformation"/>
774777
/// </example>
775778
/// <value>The negotiated SSL or TLS cipher algorithm strength.</value>
779+
#if NET10_0_OR_GREATER
780+
[Obsolete ("Use SslCipherSuite instead.")]
781+
#endif
776782
public override int? SslCipherStrength {
777783
get {
778784
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -810,6 +816,9 @@ public override TlsCipherSuite? SslCipherSuite {
810816
/// <code language="c#" source="Examples\ImapExamples.cs" region="SslConnectionInformation"/>
811817
/// </example>
812818
/// <value>The negotiated SSL or TLS hash algorithm.</value>
819+
#if NET10_0_OR_GREATER
820+
[Obsolete ("Use SslCipherSuite instead.")]
821+
#endif
813822
public override HashAlgorithmType? SslHashAlgorithm {
814823
get {
815824
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -829,6 +838,9 @@ public override HashAlgorithmType? SslHashAlgorithm {
829838
/// <code language="c#" source="Examples\ImapExamples.cs" region="SslConnectionInformation"/>
830839
/// </example>
831840
/// <value>The negotiated SSL or TLS hash algorithm strength.</value>
841+
#if NET10_0_OR_GREATER
842+
[Obsolete ("Use SslCipherSuite instead.")]
843+
#endif
832844
public override int? SslHashStrength {
833845
get {
834846
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -848,6 +860,9 @@ public override int? SslHashStrength {
848860
/// <code language="c#" source="Examples\ImapExamples.cs" region="SslConnectionInformation"/>
849861
/// </example>
850862
/// <value>The negotiated SSL or TLS key exchange algorithm.</value>
863+
#if NET10_0_OR_GREATER
864+
[Obsolete ("Use SslCipherSuite instead.")]
865+
#endif
851866
public override ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
852867
get {
853868
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -867,6 +882,9 @@ public override ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
867882
/// <code language="c#" source="Examples\ImapExamples.cs" region="SslConnectionInformation"/>
868883
/// </example>
869884
/// <value>The negotiated SSL or TLS key exchange algorithm strength.</value>
885+
#if NET10_0_OR_GREATER
886+
[Obsolete ("Use SslCipherSuite instead.")]
887+
#endif
870888
public override int? SslKeyExchangeStrength {
871889
get {
872890
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))

MailKit/Net/Pop3/Pop3Client.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ public override SslProtocols SslProtocol {
457457
/// <code language="c#" source="Examples\Pop3Examples.cs" region="SslConnectionInformation"/>
458458
/// </example>
459459
/// <value>The negotiated SSL or TLS cipher algorithm.</value>
460+
#if NET10_0_OR_GREATER
461+
[Obsolete ("Use SslCipherSuite instead.")]
462+
#endif
460463
public override CipherAlgorithmType? SslCipherAlgorithm {
461464
get {
462465
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -476,6 +479,9 @@ public override CipherAlgorithmType? SslCipherAlgorithm {
476479
/// <code language="c#" source="Examples\Pop3Examples.cs" region="SslConnectionInformation"/>
477480
/// </example>
478481
/// <value>The negotiated SSL or TLS cipher algorithm strength.</value>
482+
#if NET10_0_OR_GREATER
483+
[Obsolete ("Use SslCipherSuite instead.")]
484+
#endif
479485
public override int? SslCipherStrength {
480486
get {
481487
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -513,6 +519,9 @@ public override TlsCipherSuite? SslCipherSuite {
513519
/// <code language="c#" source="Examples\Pop3Examples.cs" region="SslConnectionInformation"/>
514520
/// </example>
515521
/// <value>The negotiated SSL or TLS hash algorithm.</value>
522+
#if NET10_0_OR_GREATER
523+
[Obsolete ("Use SslCipherSuite instead.")]
524+
#endif
516525
public override HashAlgorithmType? SslHashAlgorithm {
517526
get {
518527
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -532,6 +541,9 @@ public override HashAlgorithmType? SslHashAlgorithm {
532541
/// <code language="c#" source="Examples\Pop3Examples.cs" region="SslConnectionInformation"/>
533542
/// </example>
534543
/// <value>The negotiated SSL or TLS hash algorithm strength.</value>
544+
#if NET10_0_OR_GREATER
545+
[Obsolete ("Use SslCipherSuite instead.")]
546+
#endif
535547
public override int? SslHashStrength {
536548
get {
537549
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -551,6 +563,9 @@ public override int? SslHashStrength {
551563
/// <code language="c#" source="Examples\Pop3Examples.cs" region="SslConnectionInformation"/>
552564
/// </example>
553565
/// <value>The negotiated SSL or TLS key exchange algorithm.</value>
566+
#if NET10_0_OR_GREATER
567+
[Obsolete ("Use SslCipherSuite instead.")]
568+
#endif
554569
public override ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
555570
get {
556571
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))
@@ -570,6 +585,9 @@ public override ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
570585
/// <code language="c#" source="Examples\Pop3Examples.cs" region="SslConnectionInformation"/>
571586
/// </example>
572587
/// <value>The negotiated SSL or TLS key exchange algorithm strength.</value>
588+
#if NET10_0_OR_GREATER
589+
[Obsolete ("Use SslCipherSuite instead.")]
590+
#endif
573591
public override int? SslKeyExchangeStrength {
574592
get {
575593
if (IsSecure && (engine.Stream.Stream is SslStream sslStream))

MailKit/Net/Smtp/SmtpClient.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@ public override SslProtocols SslProtocol {
458458
/// <code language="c#" source="Examples\SmtpExamples.cs" region="SslConnectionInformation"/>
459459
/// </example>
460460
/// <value>The negotiated SSL or TLS cipher algorithm.</value>
461+
#if NET10_0_OR_GREATER
462+
[Obsolete ("Use SslCipherSuite instead.")]
463+
#endif
461464
public override CipherAlgorithmType? SslCipherAlgorithm {
462465
get {
463466
if (IsSecure && (Stream.Stream is SslStream sslStream))
@@ -477,6 +480,9 @@ public override CipherAlgorithmType? SslCipherAlgorithm {
477480
/// <code language="c#" source="Examples\SmtpExamples.cs" region="SslConnectionInformation"/>
478481
/// </example>
479482
/// <value>The negotiated SSL or TLS cipher algorithm strength.</value>
483+
#if NET10_0_OR_GREATER
484+
[Obsolete ("Use SslCipherSuite instead.")]
485+
#endif
480486
public override int? SslCipherStrength {
481487
get {
482488
if (IsSecure && (Stream.Stream is SslStream sslStream))
@@ -514,6 +520,9 @@ public override TlsCipherSuite? SslCipherSuite {
514520
/// <code language="c#" source="Examples\SmtpExamples.cs" region="SslConnectionInformation"/>
515521
/// </example>
516522
/// <value>The negotiated SSL or TLS hash algorithm.</value>
523+
#if NET10_0_OR_GREATER
524+
[Obsolete ("Use SslCipherSuite instead.")]
525+
#endif
517526
public override HashAlgorithmType? SslHashAlgorithm {
518527
get {
519528
if (IsSecure && (Stream.Stream is SslStream sslStream))
@@ -533,6 +542,9 @@ public override HashAlgorithmType? SslHashAlgorithm {
533542
/// <code language="c#" source="Examples\SmtpExamples.cs" region="SslConnectionInformation"/>
534543
/// </example>
535544
/// <value>The negotiated SSL or TLS hash algorithm strength.</value>
545+
#if NET10_0_OR_GREATER
546+
[Obsolete ("Use SslCipherSuite instead.")]
547+
#endif
536548
public override int? SslHashStrength {
537549
get {
538550
if (IsSecure && (Stream.Stream is SslStream sslStream))
@@ -552,6 +564,9 @@ public override int? SslHashStrength {
552564
/// <code language="c#" source="Examples\SmtpExamples.cs" region="SslConnectionInformation"/>
553565
/// </example>
554566
/// <value>The negotiated SSL or TLS key exchange algorithm.</value>
567+
#if NET10_0_OR_GREATER
568+
[Obsolete ("Use SslCipherSuite instead.")]
569+
#endif
555570
public override ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
556571
get {
557572
if (IsSecure && (Stream.Stream is SslStream sslStream))
@@ -571,6 +586,9 @@ public override ExchangeAlgorithmType? SslKeyExchangeAlgorithm {
571586
/// <code language="c#" source="Examples\SmtpExamples.cs" region="SslConnectionInformation"/>
572587
/// </example>
573588
/// <value>The negotiated SSL or TLS key exchange algorithm strength.</value>
589+
#if NET10_0_OR_GREATER
590+
[Obsolete ("Use SslCipherSuite instead.")]
591+
#endif
574592
public override int? SslKeyExchangeStrength {
575593
get {
576594
if (IsSecure && (Stream.Stream is SslStream sslStream))

0 commit comments

Comments
 (0)