LegacyTlsClient.cs 965 B

1234567891011121314151617181920212223242526272829303132
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls;
  4. namespace Org.BouncyCastle.Crypto.Tls2
  5. {
  6. /// <summary>
  7. /// A temporary class to use LegacyTlsAuthentication
  8. /// </summary>
  9. public sealed class LegacyTlsClient : DefaultTlsClient
  10. {
  11. private readonly Uri TargetUri;
  12. private readonly ICertificateVerifyer verifyer;
  13. private readonly IClientCredentialsProvider credProvider;
  14. public LegacyTlsClient(Uri targetUri, ICertificateVerifyer verifyer, IClientCredentialsProvider prov, System.Collections.Generic.List<string> hostNames)
  15. {
  16. this.TargetUri = targetUri;
  17. this.verifyer = verifyer;
  18. this.credProvider = prov;
  19. this.HostNames = hostNames;
  20. }
  21. public override TlsAuthentication GetAuthentication()
  22. {
  23. return new LegacyTlsAuthentication(this.TargetUri, verifyer, credProvider);
  24. }
  25. }
  26. }
  27. #endif