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

Function main

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

Source from the content-addressed store, hash-verified

262}
263
264int main(int argc, char* argv[]) {
265 acl::string addr = "0.0.0.0|1443";
266 acl::string ssl_crt = "../ssl_crt.pem", ssl_key = "../ssl_key.pem";
267 acl::string ssl_type = "openssl";
268 acl::string ssl_libs;
269 int rw_timeout = 5, times = 1;
270
271 int ch;
272 while ((ch = getopt(argc, argv, "hs:t:L:c:k:r:o:o:")) > 0) {
273 switch (ch) {
274 case 'h':
275 usage(argv[0]);
276 return 0;
277 case 's':
278 addr = optarg;
279 break;
280 case 't':
281 ssl_type = optarg;
282 break;
283 case 'L':
284 ssl_libs = optarg;
285 break;
286 case 'c':
287 ssl_crt = optarg;
288 break;
289 case 'k':
290 ssl_key = optarg;
291 break;
292 case 'r':
293 rw_timeout = atoi(optarg);
294 break;
295 case 'o':
296 times = atoi(optarg);
297 break;
298 default:
299 break;
300 }
301 }
302
303 acl::acl_cpp_init();
304 acl::log::stdout_open(true);
305
306 acl::sslbase_conf* ssl_conf;
307
308 if (ssl_type == "mbedtls") {
309 ssl_conf = load_mbedtls(ssl_libs);
310 } else if (ssl_type == "openssl") {
311 ssl_conf = load_openssl(ssl_libs);
312 } else {
313 printf("Not support ssl type=%s\r\n", ssl_type.c_str());
314 return 1;
315 }
316
317 if (!ssl_conf) {
318 printf("Load ssl error, libs=%s\r\n", ssl_libs.c_str());
319 return 1;
320 }
321

Callers

nothing calls this directly

Calls 8

acl_cpp_initFunction · 0.85
start_serverFunction · 0.85
usageFunction · 0.70
load_mbedtlsFunction · 0.70
load_opensslFunction · 0.70
ssl_initFunction · 0.70
getoptFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…