On Sun, Oct 3, 2010 at 12:01 AM, Enlightenment SVN
<[email protected]> wrote:
> Log:
>  update to connect to www.verisign.com:443 by default, loading all certs in 
> /etc/ssl/certs prior
>
> Author:       discomfitor
> Date:         2010-10-02 15:01:14 -0700 (Sat, 02 Oct 2010)
> New Revision: 52986
>
> Modified:
>  trunk/ecore/examples/ecore_con_client_example.c
>
> Modified: trunk/ecore/examples/ecore_con_client_example.c
> ===================================================================
> --- trunk/ecore/examples/ecore_con_client_example.c     2010-10-02 21:13:56 
> UTC (rev 52985)
> +++ trunk/ecore/examples/ecore_con_client_example.c     2010-10-02 22:01:14 
> UTC (rev 52986)
> @@ -50,6 +50,9 @@
>  int main()
>  {
>    Ecore_Con_Server *svr;
> +   Eina_Iterator *it;
> +   const char *ca;
> +
>    eina_init();
>    ecore_init();
>    ecore_con_init();
> @@ -58,11 +61,21 @@
>    gnutls_global_set_log_level(9);
>    gnutls_global_set_log_function(tls_log_func);
>
> +   if (!(it = eina_file_ls("/etc/ssl/certs")))
> +     exit(1);

That's a very bad idea to exit. Printing a warning would be much better.

> +   if (!(svr = ecore_con_server_connect(ECORE_CON_REMOTE_TCP | 
> ECORE_CON_USE_MIXED, "www.verisign.com", 443, NULL)))
> +     exit(1);
>
> -   if (!(svr = ecore_con_server_connect(ECORE_CON_REMOTE_TCP | 
> ECORE_CON_USE_MIXED, "localhost", 8080, NULL)))
> -     exit(1);
> -   ecore_con_ssl_server_cafile_add(svr, "/etc/ssl/certs/vsign2.pem");
> +   /* add all the CAs */
> +   EINA_ITERATOR_FOREACH(it, ca)
> +     {
> +        if (!ecore_con_ssl_server_cafile_add(svr, ca))
> +          printf("Could not load CA: %s!\n", ca);
> +        eina_stringshare_del(ca);
> +     }
> +
> +   eina_iterator_free(it);
>    ecore_con_ssl_server_verify(svr);
>
>  /* set event handler for server connect */
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
>



-- 
Cedric BAIL

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to