Ejemplo n.º 1
0
 /// <summary>
 /// <para>Get the names of all session providers on the system.</para>
 /// </summary>
 ///
 /// <returns>
 /// <para>An array of session provider names.</para>
 /// </returns>
 public static String[] GetProviders()
 {
                 #if CONFIG_RUNTIME_INFRA
     // Probe the handlers to see which ones are available.
     bool haveGNUTLS, haveOpenSSL;
     ISecureSessionProvider provider;
     try
     {
         provider   = new GNUTLS();
         haveGNUTLS = true;
     }
     catch (NotSupportedException)
     {
         haveGNUTLS = false;
     }
     try
     {
         provider    = new OpenSSL();
         haveOpenSSL = true;
     }
     catch (NotSupportedException)
     {
         haveOpenSSL = false;
     }
     if (haveGNUTLS && haveOpenSSL)
     {
         return(new String[] { "GNUTLS", "OpenSSL" });
     }
     else if (haveGNUTLS)
     {
         return(new String[] { "GNUTLS" });
     }
     else if (haveOpenSSL)
     {
         return(new String[] { "OpenSSL" });
     }
                 #endif
     return(new String [0]);
 }
	/// <summary>
	/// <para>Get the names of all session providers on the system.</para>
	/// </summary>
	///
	/// <returns>
	/// <para>An array of session provider names.</para>
	/// </returns>
	public static String[] GetProviders()
			{
			#if CONFIG_RUNTIME_INFRA
				// Probe the handlers to see which ones are available.
				bool haveGNUTLS, haveOpenSSL;
				ISecureSessionProvider provider;
				try
				{
					provider = new GNUTLS();
					haveGNUTLS = true;
				}
				catch(NotSupportedException)
				{
					haveGNUTLS = false;
				}
				try
				{
					provider = new OpenSSL();
					haveOpenSSL = true;
				}
				catch(NotSupportedException)
				{
					haveOpenSSL = false;
				}
				if(haveGNUTLS && haveOpenSSL)
				{
					return new String[] {"GNUTLS", "OpenSSL"};
				}
				else if(haveGNUTLS)
				{
					return new String[] {"GNUTLS"};
				}
				else if(haveOpenSSL)
				{
					return new String[] {"OpenSSL"};
				}
			#endif
				return new String [0];
			}