You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
proxysql/src/proxysql_global.cpp

25 lines
687 B

#define PROXYSQL_EXTERN
#include "proxysql.h"
//#include "proxysql_glovars.hpp"
#include "cpp.h"
//ProxySQL_GlobalVariables GloVars;
SSL_CTX * ProxySQL_GlobalVariables::get_SSL_ctx() {
// take the mutex
std::lock_guard<std::mutex> lock(global.ssl_mutex);
return GloVars.global.ssl_ctx;
}
SSL * ProxySQL_GlobalVariables::get_SSL_new() {
// take the mutex
std::lock_guard<std::mutex> lock(global.ssl_mutex);
return SSL_new(GloVars.global.ssl_ctx);
}
void ProxySQL_GlobalVariables::get_SSL_pem_mem(char **key, char **cert) {
// take the mutex
std::lock_guard<std::mutex> lock(global.ssl_mutex);
*key = strdup(global.ssl_key_pem_mem);
*cert = strdup(global.ssl_cert_pem_mem);
}