TlsNoCloseNotifyException.cs 1.1 KB

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