public SslContext GetContext()
        {
            if (sslContext == null)
            {
                var certBytes = certificateBytesAsset.Bytes;
                try
                {
                    X509Certificate2 cert = new X509Certificate2(certBytes, password);
                    sslContext = new SslContext(protocols, cert, OnValidationCallback);
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                }
            }

            return(sslContext);
        }
Esempio n. 2
0
 /// <summary>
 /// Initialize WebSocket client with a given IP endpoint
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="endpoint">IP endpoint</param>
 public WssClient(SslContext context, IPEndPoint endpoint) : base(context, endpoint)
 {
     WebSocket = new WebSocket(this);
 }
Esempio n. 3
0
 /// <summary>
 /// Initialize WebSocket client with a given IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public WssClient(SslContext context, string address, int port) : base(context, address, port)
 {
     WebSocket = new WebSocket(this);
 }
Esempio n. 4
0
 /// <summary>
 /// Initialize SSL server with a given IP endpoint
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="endpoint">IP endpoint</param>
 public SslServer(SslContext context, IPEndPoint endpoint)
 {
     Id       = Guid.NewGuid();
     Context  = context;
     Endpoint = endpoint;
 }
Esempio n. 5
0
 /// <summary>
 /// Initialize SSL server with a given IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public SslServer(SslContext context, string address, int port) : this(context, new IPEndPoint(IPAddress.Parse(address), port))
 {
 }
Esempio n. 6
0
 /// <summary>
 /// Initialize WebSocket server with a given IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public WssServer(SslContext context, IPAddress address, int port) : base(context, address, port)
 {
     WebSocket = new WebSocket(this);
 }
 /// <summary>
 /// Initialize HTTPS client with a given IP endpoint
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="endpoint">IP endpoint</param>
 public HttpsClient(SslContext context, IPEndPoint endpoint) : base(context, endpoint)
 {
     Request = new HttpRequest(); Response = new HttpResponse();
 }
 /// <inheritdoc />
 public UnitySslClient(SslContext context, string address, int port) : base(context, address, port)
 {
     queueBuffer        = new MemoryStream(OptionReceiveBufferSize);
     queueBufferPointer = new Queue <BufferPointer>();
 }
 /// <summary>
 /// Initialize HTTPS client with a given IP endpoint
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="endpoint">IP endpoint</param>
 public HttpsClientEx(SslContext context, IPEndPoint endpoint) : base(context, endpoint)
 {
 }
Esempio n. 10
0
 /// <summary>
 /// Initialize HTTPS client with a given IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public HttpsClientEx(SslContext context, string address, int port) : base(context, address, port)
 {
 }
 public void OnAfterDeserialize()
 {
     sslContext = null;
 }
 public void OnBeforeSerialize()
 {
     sslContext = null;
 }
Esempio n. 13
0
 /// <summary>
 /// Initialize HTTPS server with a given IP endpoint
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="endpoint">IP endpoint</param>
 public HttpsServer(SslContext context, IPEndPoint endpoint) : base(context, endpoint)
 {
     Cache = new FileCache();
 }
Esempio n. 14
0
 /// <summary>
 /// Initialize HTTPS server with a given IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public HttpsServer(SslContext context, string address, int port) : base(context, address, port)
 {
     Cache = new FileCache();
 }
Esempio n. 15
0
 /// <summary>
 /// Initialize SSL client with a given server IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public SslClient(SslContext context, IPAddress address, int port) : this(context, new IPEndPoint(address, port))
 {
 }
Esempio n. 16
0
 /// <summary>
 /// Initialize HTTPS client with a given IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public HttpsClient(SslContext context, string address, int port) : base(context, address, port)
 {
     Request = new HttpRequest(); Response = new HttpResponse();
 }
Esempio n. 17
0
 /// <summary>
 /// Initialize SSL client with a given server IP address and port number
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="address">IP address</param>
 /// <param name="port">Port number</param>
 public SslClient(SslContext context, string address, int port) : this(context, new IPEndPoint(IPAddress.Parse(address), port))
 {
     Address = address;
 }
Esempio n. 18
0
 /// <summary>
 /// Initialize SSL server with a given IP endpoint
 /// </summary>
 /// <param name="context">SSL context</param>
 /// <param name="endpoint">IP endpoint</param>
 public SslServer(SslContext context, IPEndPoint endpoint)
 {
     Context = context; Endpoint = endpoint;
 }