Commit 68b3b1c7 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Added function to check for specific TLS implementation

parent 9cbc110f
......@@ -15,12 +15,28 @@
#endif
#include <stdlib.h>
#include <strings.h>
#include "tls.h"
#include "logging.h"
#define CATMODULE "tls"
/* Check for a specific implementation. Returns 0 if supported, 1 if unsupported and -1 on error. */
int tls_check_impl(const char *impl)
{
#ifdef HAVE_OPENSSL
if (!strcasecmp(impl, "openssl"))
return 0;
#endif
#ifdef ICECAST_CAP_TLS
if (!strcasecmp(impl, "generic"))
return 0;
#endif
return 1;
}
#ifdef HAVE_OPENSSL
struct tls_ctx_tag {
size_t refc;
......
......@@ -25,6 +25,9 @@
typedef struct tls_ctx_tag tls_ctx_t;
typedef struct tls_tag tls_t;
/* Check for a specific implementation. Returns 0 if supported, 1 if unsupported and -1 on error. */
int tls_check_impl(const char *impl);
void tls_initialize(void);
void tls_shutdown(void);
......
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