TlsNoCloseNotifyException.cs 994 B

123456789101112131415161718192021222324252627
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.IO;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
  6. {
  7. /// <summary>
  8. /// This exception will be thrown(only) when the connection is closed by the peer without sending a
  9. /// <code cref="AlertDescription.close_notify">close_notify</code> warning alert.
  10. /// </summary>
  11. /// <remarks>
  12. /// If this happens, the TLS protocol cannot rule out truncation of the connection data (potentially
  13. /// malicious). It may be possible to check for truncation via some property of a higher level protocol
  14. /// built upon TLS, e.g.the Content-Length header for HTTPS.
  15. /// </remarks>
  16. public class TlsNoCloseNotifyException
  17. : EndOfStreamException
  18. {
  19. public TlsNoCloseNotifyException()
  20. : base("No close_notify alert received before connection closed")
  21. {
  22. }
  23. }
  24. }
  25. #pragma warning restore
  26. #endif