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

Function load_openssl

lib_acl_cpp/samples/ssl/server/main.cpp:212–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212static acl::sslbase_conf* load_openssl(acl::string& ssl_libs)
213{
214#if defined(__APPLE__)
215 acl::string libcrypto = "/usr/local/lib/libcrypto.dylib";
216 acl::string libssl = "/usr/local/lib/libssl.dylib";
217#elif defined(__linux__)
218 acl::string libcrypto = "/usr/local/lib64/libcrypto.so";
219 acl::string libssl = "/usr/local/lib64/libssl.so";
220#else
221# error "Unsupport OS!"
222#endif
223 if (!ssl_libs.empty()) {
224 const std::vector<acl::string>& libs = ssl_libs.split2(",; \t");
225 if (libs.size() >= 2) {
226 libcrypto = libs[0];
227 libssl = libs[1];
228 } else {
229 libssl = libs[0];
230 }
231 }
232
233 // ���� OpenSSL ��̬��ļ���·��
234 acl::openssl_conf::set_libpath(libcrypto, libssl);
235
236 // ��̬���� OpenSSL ��̬��
237 if (!acl::openssl_conf::load()) {
238 printf("load ssl error=%s, crypto=%s, ssl=%s\r\n",
239 acl::last_serror(), libcrypto.c_str(), libssl.c_str());
240 return NULL;
241 }
242
243 bool server_side = true;
244
245 acl::sslbase_conf* conf = new acl::openssl_conf(server_side);
246 conf->set_sni_checker(new ssl_sni_checker());
247 return conf;
248}
249
250//////////////////////////////////////////////////////////////////////////////
251

Callers 1

mainFunction · 0.70

Calls 4

last_serrorFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…