LegacyTlsClient.cs 905 B

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