MCPcopy Create free account
hub / github.com/acl-dev/acl / proc_on_init

Method proc_on_init

app/wizard/tmpl/http/master_threads.cpp:189–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189void master_service::proc_on_init(void)
190{
191 // create redis cluster for session cluster
192 redis_ = new acl::redis_client_cluster;
193 redis_->init(NULL, var_cfg_redis_addrs, var_cfg_max_threads,
194 var_cfg_conn_timeout, var_cfg_rw_timeout);
195
196 // ����������ʼ�� SSL ����
197
198 if (var_cfg_crt_file == NULL || *var_cfg_crt_file == 0
199 || var_cfg_key_file == NULL || *var_cfg_key_file == 0) {
200 logger("not use SSL mode");
201 return;
202 }
203
204 if (strstr(var_cfg_libssl_path, "mbedtls")) {
205 acl::mbedtls_conf::set_libpath(var_cfg_libcrypto_path,
206 var_cfg_libx509_path, var_cfg_libssl_path);
207 if (!acl::mbedtls_conf::load()) {
208 logger_error("load %s error", var_cfg_libssl_path);
209 return;
210 }
211
212 logger("MbedTLS loaded, crypto=%s, x509=%s, ssl=%s",
213 var_cfg_libcrypto_path, var_cfg_libx509_path,
214 var_cfg_libssl_path);
215
216 conf_ = new acl::mbedtls_conf(true);
217 } else if (strstr(var_cfg_libssl_path, "polarssl")) {
218 acl::polarssl_conf::set_libpath(var_cfg_libssl_path);
219 if (!acl::polarssl_conf::load()) {
220 logger_error("load %s error", var_cfg_libssl_path);
221 return;
222 }
223
224 logger("PolarSSL loaded, ssl=%s", var_cfg_libssl_path);
225
226 conf_ = new acl::polarssl_conf();
227 } else if (strstr(var_cfg_libssl_path, "libssl")) {
228 acl::openssl_conf::set_libpath(var_cfg_libcrypto_path,
229 var_cfg_libssl_path);
230 if (!acl::openssl_conf::load()) {
231 logger_error("load %s error", var_cfg_libssl_path);
232 return;
233 }
234
235 logger("OpenSSL loaded, crypto=%s, ssl=%s",
236 var_cfg_libcrypto_path, var_cfg_libssl_path);
237
238 conf_ = new acl::openssl_conf(true);
239 } else {
240 logger("unsupported ssl=%s", var_cfg_libssl_path);
241 return;
242 }
243
244 // ��������˵� SSL �Ự���湦��
245 conf_->enable_cache(var_cfg_ssl_session_cache);
246

Callers

nothing calls this directly

Calls 3

initMethod · 0.45
enable_cacheMethod · 0.45
add_certMethod · 0.45

Tested by

no test coverage detected