libssl's path should not be hard coded (#123)

This commit is contained in:
HF
2024-06-25 17:47:30 +08:00
committed by GitHub
parent 21ed62b3a2
commit 8dae44e69f
3 changed files with 15 additions and 15 deletions

View File

@@ -315,7 +315,7 @@ int BPF_URETPROBE(probe_SSL_do_handshake_exit) {
if (env.openssl) { if (env.openssl) {
char *openssl_path = find_library_path("libssl.so"); char *openssl_path = find_library_path("libssl.so");
printf("OpenSSL path: %s\n", openssl_path); printf("OpenSSL path: %s\n", openssl_path);
attach_openssl(obj, "/lib/x86_64-linux-gnu/libssl.so.3"); attach_openssl(obj, openssl_path);
} }
if (env.gnutls) { if (env.gnutls) {
char *gnutls_path = find_library_path("libgnutls.so"); char *gnutls_path = find_library_path("libgnutls.so");

View File

@@ -325,7 +325,7 @@ To achieve this functionality, the `find_library_path` function is first used to
if (env.openssl) { if (env.openssl) {
char *openssl_path = find_library_path("libssl.so"); char *openssl_path = find_library_path("libssl.so");
printf("OpenSSL path: %s\n", openssl_path); printf("OpenSSL path: %s\n", openssl_path);
attach_openssl(obj, "/lib/x86_64-linux-gnu/libssl.so.3"); attach_openssl(obj, openssl_path);
} }
if (env.gnutls) { if (env.gnutls) {
char *gnutls_path = find_library_path("libgnutls.so"); char *gnutls_path = find_library_path("libgnutls.so");

View File

@@ -397,7 +397,7 @@ int main(int argc, char **argv) {
if (env.openssl) { if (env.openssl) {
char *openssl_path = find_library_path("libssl.so"); char *openssl_path = find_library_path("libssl.so");
printf("OpenSSL path: %s\n", openssl_path); printf("OpenSSL path: %s\n", openssl_path);
attach_openssl(obj, "/lib/x86_64-linux-gnu/libssl.so.3"); attach_openssl(obj, openssl_path);
} }
if (env.gnutls) { if (env.gnutls) {
char *gnutls_path = find_library_path("libgnutls.so"); char *gnutls_path = find_library_path("libgnutls.so");