FakeTlsConnectionFeature.cs 826 B

123456789101112131415161718192021222324252627
  1. using Microsoft.AspNetCore.Http.Features;
  2. using System;
  3. using System.Security.Cryptography.X509Certificates;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. namespace FastGithub.HttpServer.TlsMiddlewares
  7. {
  8. /// <summary>
  9. /// 假冒的TlsConnectionFeature
  10. /// </summary>
  11. sealed class FakeTlsConnectionFeature : ITlsConnectionFeature
  12. {
  13. public static FakeTlsConnectionFeature Instance { get; } = new FakeTlsConnectionFeature();
  14. public X509Certificate2? ClientCertificate
  15. {
  16. get => throw new NotImplementedException();
  17. set => throw new NotImplementedException();
  18. }
  19. public Task<X509Certificate2?> GetClientCertificateAsync(CancellationToken cancellationToken)
  20. {
  21. throw new NotImplementedException();
  22. }
  23. }
  24. }