Add support for TLS

SVN revision: 33400
This commit is contained in:
Sebastian Dransfeld 2008-01-08 21:28:51 +00:00
parent d67f5ab32f
commit 8cb8f0e249
2 changed files with 10 additions and 1 deletions

View File

@ -75,7 +75,8 @@ extern "C" {
ECORE_CON_LOCAL_ABSTRACT, ECORE_CON_LOCAL_ABSTRACT,
ECORE_CON_REMOTE_SYSTEM, ECORE_CON_REMOTE_SYSTEM,
ECORE_CON_USE_SSL2 = (1 << 4), ECORE_CON_USE_SSL2 = (1 << 4),
ECORE_CON_USE_SSL3 = (1 << 5) ECORE_CON_USE_SSL3 = (1 << 5),
ECORE_CON_USE_TLS = (1 << 6)
} Ecore_Con_Type; } Ecore_Con_Type;
#define ECORE_CON_USE_SSL ECORE_CON_USE_SSL2 #define ECORE_CON_USE_SSL ECORE_CON_USE_SSL2

View File

@ -334,6 +334,10 @@ ecore_con_server_add(Ecore_Con_Type compl_type, const char *name, int port,
if (!(svr->ssl_ctx = SSL_CTX_new(SSLv3_client_method()))) if (!(svr->ssl_ctx = SSL_CTX_new(SSLv3_client_method())))
goto error; goto error;
break; break;
case ECORE_CON_USE_TLS:
if (!(svr->ssl_ctx = SSL_CTX_new(TLSv1_client_method())))
goto error;
break;
} }
if (!(svr->ssl = SSL_new(svr->ssl_ctx))) if (!(svr->ssl = SSL_new(svr->ssl_ctx)))
@ -1192,6 +1196,10 @@ _ecore_con_cb_dns_lookup(void *data, struct hostent *he)
if (!(svr->ssl_ctx = SSL_CTX_new(SSLv3_client_method()))) if (!(svr->ssl_ctx = SSL_CTX_new(SSLv3_client_method())))
goto error; goto error;
break; break;
case ECORE_CON_USE_TLS:
if (!(svr->ssl_ctx = SSL_CTX_new(TLSv1_client_method())))
goto error;
break;
} }
if (!(svr->ssl = SSL_new(svr->ssl_ctx))) if (!(svr->ssl = SSL_new(svr->ssl_ctx)))