Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssl not use locking after 1.1.0 #434

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

beef9999
Copy link
Collaborator

@beef9999 beef9999 commented Mar 31, 2024

Going to backport to 0.7

@@ -281,9 +281,9 @@ IFileSystem* new_httpfs_v2(bool default_https, uint64_t conn_timeout,
client, client_ownership);
}

IFile* new_httpfile_v2(const char* url, HttpFs_v2* httpfs, uint64_t conn_timeout,
IFile* new_httpfile_v2(const char* url, IFileSystem* httpfs, uint64_t conn_timeout,
Copy link
Collaborator Author

@beef9999 beef9999 Mar 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mismatch to header file, cause undefined symbols

@@ -139,7 +139,8 @@ class KernelSocketStream : public SocketStreamBase {
return (Object*) (uint64_t) fd;
}
int close() final {
get_vcpu()->master_event_engine->wait_for_fd(fd, 0, -1UL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (fd < 0) return 0;

@@ -76,17 +76,21 @@ class GlobalSSLContext : public Singleton<GlobalSSLContext> {
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
OpenSSL_add_all_algorithms();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a function to obtain openssl version dynamically? If so, it's better to use if instead of #if.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSLeay_version(). But it will output string like OpenSSL 1.0.1a 15 Oct 2015, not handy to use.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://github.com/openssl/openssl/blob/OpenSSL_1_1_0-stable/crypto/cversion.c

we can use SSLeay() for versions before 1.1, and OpenSSL_version_num() for those after 1.1.

Copy link
Collaborator

@lihuiba lihuiba Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probe for the above functions with dlopen(filename==NULL) and dlsymbol(), and decide which one to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants