|
81 | 81 | #include "upipe-pthread/uprobe_pthread_upump_mgr.h" |
82 | 82 | #include "upipe-pthread/upipe_pthread_transfer.h" |
83 | 83 | #include "upipe-pthread/umutex_pthread.h" |
| 84 | +#ifdef UPIPE_HAVE_OPENSSL_SSL_H |
| 85 | +#include "upipe-openssl/uprobe_https_openssl.h" |
| 86 | +#endif |
84 | 87 | #ifdef UPIPE_HAVE_BEARSSL_H |
85 | 88 | #include "upipe-bearssl/uprobe_https_bearssl.h" |
86 | 89 | #endif |
@@ -1284,6 +1287,12 @@ enum opt { |
1284 | 1287 | OPT_DELAY, |
1285 | 1288 | OPT_QUIT_TIMEOUT, |
1286 | 1289 | OPT_USER_AGENT, |
| 1290 | +#ifdef UPIPE_HAVE_BEARSSL_H |
| 1291 | + OPT_USE_BEARSSL, |
| 1292 | +#endif |
| 1293 | +#ifdef UPIPE_HAVE_OPENSSL_SSL_H |
| 1294 | + OPT_USE_OPENSSL, |
| 1295 | +#endif |
1287 | 1296 | }; |
1288 | 1297 |
|
1289 | 1298 | static struct option options[] = { |
@@ -1314,6 +1323,12 @@ static struct option options[] = { |
1314 | 1323 | { "delay", required_argument, NULL, OPT_DELAY }, |
1315 | 1324 | { "quit-timeout", required_argument, NULL, OPT_QUIT_TIMEOUT }, |
1316 | 1325 | { "user-agent", required_argument, NULL, OPT_USER_AGENT }, |
| 1326 | +#ifdef UPIPE_HAVE_BEARSSL_H |
| 1327 | + { "use-bearssl", no_argument, NULL, OPT_USE_BEARSSL }, |
| 1328 | +#endif |
| 1329 | +#ifdef UPIPE_HAVE_OPENSSL_SSL_H |
| 1330 | + { "use-openssl", no_argument, NULL, OPT_USE_OPENSSL }, |
| 1331 | +#endif |
1317 | 1332 | { 0, 0, 0, 0 }, |
1318 | 1333 | }; |
1319 | 1334 |
|
@@ -1354,6 +1369,14 @@ int main(int argc, char **argv) |
1354 | 1369 | enum upipe_ts_conformance conformance = UPIPE_TS_CONFORMANCE_AUTO; |
1355 | 1370 | bool no_stdin = false; |
1356 | 1371 |
|
| 1372 | +#ifdef UPIPE_HAVE_BEARSSL_H |
| 1373 | + bool use_bearssl = true; |
| 1374 | +#endif |
| 1375 | + |
| 1376 | +#ifdef UPIPE_HAVE_OPENSSL_SSL_H |
| 1377 | + bool use_openssl = true; |
| 1378 | +#endif |
| 1379 | + |
1357 | 1380 | /* |
1358 | 1381 | * parse options |
1359 | 1382 | */ |
@@ -1458,6 +1481,24 @@ int main(int argc, char **argv) |
1458 | 1481 |
|
1459 | 1482 | case OPT_MISSING_ARG: |
1460 | 1483 | return usage(argv[0], "missing argument"); |
| 1484 | + |
| 1485 | +#ifdef UPIPE_HAVE_BEARSSL_H |
| 1486 | + case OPT_USE_BEARSSL: |
| 1487 | + use_bearssl = true; |
| 1488 | +#ifdef UPIPE_HAVE_OPENSSL_SSL_H |
| 1489 | + use_openssl = false; |
| 1490 | +#endif |
| 1491 | + break; |
| 1492 | +#endif |
| 1493 | + |
| 1494 | +#ifdef UPIPE_HAVE_OPENSSL_SSL_H |
| 1495 | + case OPT_USE_OPENSSL: |
| 1496 | + use_openssl = true; |
| 1497 | +#ifdef UPIPE_HAVE_BEARSSL_H |
| 1498 | + use_bearssl = false; |
| 1499 | +#endif |
| 1500 | + break; |
| 1501 | +#endif |
1461 | 1502 | } |
1462 | 1503 | } |
1463 | 1504 |
|
@@ -1751,9 +1792,17 @@ int main(int argc, char **argv) |
1751 | 1792 | uprobe_init(&probe_src, catch_src, uprobe_use(main_probe)); |
1752 | 1793 | uprobe_release(main_probe); |
1753 | 1794 | main_probe = &probe_src; |
| 1795 | + |
| 1796 | +#ifdef UPIPE_HAVE_OPENSSL_SSL_H |
| 1797 | + if (use_openssl) |
| 1798 | + main_probe = uprobe_https_openssl_alloc(main_probe); |
| 1799 | +#endif |
| 1800 | + |
1754 | 1801 | #ifdef UPIPE_HAVE_BEARSSL_H |
1755 | | - main_probe = uprobe_https_bearssl_alloc(main_probe); |
| 1802 | + if (use_bearssl) |
| 1803 | + main_probe = uprobe_https_bearssl_alloc(main_probe); |
1756 | 1804 | #endif |
| 1805 | + |
1757 | 1806 | { |
1758 | 1807 | struct upipe_mgr *upipe_auto_src_mgr = upipe_auto_src_mgr_alloc(); |
1759 | 1808 | assert(upipe_auto_src_mgr); |
|
0 commit comments