mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
use TLS in integration test
This commit is contained in:
@@ -95,6 +95,13 @@ void wfp_client_config_set_certpath(
|
||||
wfp_impl_client_config_set_certpath(config, cert_path);
|
||||
}
|
||||
|
||||
void wfp_client_config_set_ca_filepath(
|
||||
struct wfp_client_config * config,
|
||||
char const * ca_filepath)
|
||||
{
|
||||
wfp_impl_client_config_set_ca_filepath(config, ca_filepath);
|
||||
}
|
||||
|
||||
void wfp_client_config_set_onconnected(
|
||||
struct wfp_client_config * config,
|
||||
wfp_connected_fn * handler)
|
||||
|
||||
@@ -43,7 +43,10 @@ struct wfp_client * wfp_impl_client_create(
|
||||
|
||||
if ((NULL != config->cert_path) && (NULL != config->key_path))
|
||||
{
|
||||
|
||||
client->info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
|
||||
client->info.client_ssl_cert_filepath = config->cert_path;
|
||||
client->info.client_ssl_private_key_filepath = config->key_path;
|
||||
client->info.client_ssl_ca_filepath = config->ca_filepath;
|
||||
}
|
||||
|
||||
client->context = lws_create_context(&client->info);
|
||||
|
||||
@@ -10,6 +10,7 @@ struct wfp_client_config * wfp_impl_client_config_create(void)
|
||||
config->user_data = NULL;
|
||||
config->key_path = NULL;
|
||||
config->cert_path = NULL;
|
||||
config->ca_filepath = NULL;
|
||||
|
||||
return config;
|
||||
}
|
||||
@@ -19,6 +20,7 @@ void wfp_impl_client_config_dispose(
|
||||
{
|
||||
free(config->key_path);
|
||||
free(config->cert_path);
|
||||
free(config->ca_filepath);
|
||||
free(config);
|
||||
}
|
||||
|
||||
@@ -45,6 +47,14 @@ void wfp_impl_client_config_set_certpath(
|
||||
config->cert_path = strdup(cert_path);
|
||||
}
|
||||
|
||||
void wfp_impl_client_config_set_ca_filepath(
|
||||
struct wfp_client_config * config,
|
||||
char const * ca_filepath)
|
||||
{
|
||||
free(config->ca_filepath);
|
||||
config->ca_filepath = strdup(ca_filepath);
|
||||
}
|
||||
|
||||
void wfp_impl_client_config_set_onconnected(
|
||||
struct wfp_client_config * config,
|
||||
wfp_connected_fn * handler)
|
||||
|
||||
@@ -15,6 +15,7 @@ struct wfp_client_config
|
||||
void * user_data;
|
||||
char * key_path;
|
||||
char * cert_path;
|
||||
char * ca_filepath;
|
||||
};
|
||||
|
||||
extern struct wfp_client_config * wfp_impl_client_config_create(void);
|
||||
@@ -34,6 +35,10 @@ extern void wfp_impl_client_config_set_certpath(
|
||||
struct wfp_client_config * config,
|
||||
char const * cert_path);
|
||||
|
||||
extern void wfp_impl_client_config_set_ca_filepath(
|
||||
struct wfp_client_config * config,
|
||||
char const * ca_filepath);
|
||||
|
||||
extern void wfp_impl_client_config_set_onconnected(
|
||||
struct wfp_client_config * config,
|
||||
wfp_connected_fn * handler);
|
||||
|
||||
Reference in New Issue
Block a user