8000 Unclear how to link with OpenSSL 3 · Issue #6869 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

Unclear how to link with OpenSSL 3 #6869

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

Closed
d94pn opened this issue Aug 28, 2024 · 4 comments
Closed

Unclear how to link with OpenSSL 3 #6869

d94pn opened this issue Aug 28, 2024 · 4 comments

Comments

@d94pn
Copy link
d94pn commented Aug 28, 2024

When building libgit2 it is not clear how to properly build with OpenSSL 3. By deafult, OpenSSL 1 on my system is linked with dynamically but I want to link (statically) with a local build of Open SSL 3. The only way to configure this is to set the OPENSSL_SSL_LIBRARY and OPENSSL_CRYPTO_LIBRARY variables when running "cmake .." but I just modifying the linking can cleary not be sufficient since OpenSSL 3 is not backward compatible with OpenSSL 1. And sure enough I get linking error.

Reproduction steps

cmake .. -DOPENSSL_SSL_LIBRARY=/Downloads/openssl-3.3.0/libssl.a -D OPENSSL_CRYP
TO_LIBRARY=/Downloads/openssl-3.3.0/libcrypto.a
cmake --build .

Expected behavior

At least a clear description of which OpenSSL versions are supported and how the build process selects either and how to override this selection if possible.

Actual behavior

/Downloads/libgit2-1.8.1/src/libgit2/streams/openssl.c:398: undefined reference to `SSL_get_peer_certificate'

Version of libgit2 (release number or SHA1)

1.8.1

Operating system(s) tested

RHEL 8.6

@ethomson
Copy link
Member
ethomson commented Oct 9, 2024

Is the problem OpenSSL 3 or dynamic linking? Is there a backward compatibility mode for OpenSSL 3? I ask because I can build, link, and run against a typical (shared library) build of OpenSSL 3.3.2 without any difficulty.

@d94pn
Copy link
Author
d94pn commented Oct 10, 2024

The problem is scanty documentation. I finally stumbled upon this tip, hidden in an error message:

-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR

Indeed, setting OPENSSL_ROOT_DIR resolved my issue. But it is not mentioned in the README file.

@ethomson
Copy link
Member

I see; that's helpful feedback; I updated the README to include this. 🙏

@d94pn
Copy link
Author
d94pn commented Oct 11, 2024

Great, thanks!

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

No branches or pull requests

2 participants
0