Commit 50da7866 authored by Simon Morlat's avatar Simon Morlat

add method to know if tls support is available

parent e319dc86
......@@ -110,6 +110,12 @@ BELLESIP_EXPORT void belle_sip_stack_set_default_dscp(belle_sip_stack_t *stack,
**/
BELLESIP_EXPORT int belle_sip_stack_get_default_dscp(belle_sip_stack_t *stack);
/**
* Returns TRUE if TLS support has been compiled into, FALSE otherwise.
**/
BELLESIP_EXPORT int belle_sip_stack_tls_available(belle_sip_stack_t *stack);
BELLE_SIP_END_DECLS
#endif
......
......@@ -85,13 +85,12 @@ belle_sip_listening_point_t * belle_sip_stream_listening_point_new(belle_sip_sta
struct belle_sip_tls_listening_point{
belle_sip_stream_listening_point_t base;
#ifdef HAVE_OPENSSL
SSL_CTX *ssl_context;
#endif
char *root_ca;
int verify_exceptions;
};
int belle_sip_tls_listening_point_available(void);
BELLE_SIP_DECLARE_CUSTOM_VPTR_BEGIN(belle_sip_tls_listening_point_t,belle_sip_listening_point_t)
BELLE_SIP_DECLARE_CUSTOM_VPTR_END
#define BELLE_SIP_TLS_LISTENING_POINT(obj) BELLE_SIP_CAST(obj,belle_sip_tls_listening_point_t)
......
......@@ -212,3 +212,7 @@ int belle_sip_stack_get_default_dscp(belle_sip_stack_t *stack){
return stack->dscp;
}
int belle_sip_stack_tls_available(belle_sip_stack_t *stack){
return belle_sip_tls_listening_point_available();
}
......@@ -101,6 +101,10 @@ int belle_sip_tls_listening_point_set_verify_exceptions(belle_sip_tls_listening_
return 0;
}
int belle_sip_tls_listening_point_available(void){
return TRUE;
}
#else
belle_sip_listening_point_t * belle_sip_tls_listening_point_new(belle_sip_stack_t *s, const char *ipaddress, int port){
......@@ -115,5 +119,9 @@ int belle_sip_tls_listening_point_set_verify_exceptions(belle_sip_tls_listening_
return -1;
}
int belle_sip_tls_listening_point_available(void){
return FALSE;
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment