-
-
Notifications
You must be signed in to change notification settings - Fork 263
Compilation fails with OpenSSL 3.0 and OPENSSL_NO_DEPRECATED #223
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
Comments
I think this is caused by a missing include. The man page for #define OPENSSL_NO_DEPRECATED
#include <openssl/rsa.h>
#include "jwt-cpp/jwt.h"
int main() { return 0; } |
Looking at OpenSSL, at least one is not deprecated https://github.com/openssl/openssl/blob/1bf649b5998ac98511203f54ce954eccfaf75467/include/openssl/rsa.h#L119 so I am curious is the problem is platform specific.... Can you please share how you are building, installing and linking against OpenSSL. There's no standard way on windows AFAIK. We test this configuration on Linux and it's passing https://github.com/Thalhammer/jwt-cpp/runs/5853386571?check_suite_focus=true I am curious what the windows vs Linux is 🤔 jwt-cpp/.github/workflows/ssl.yml Line 53 in e0f89e0
|
Thanks for the quick response! I'm using Conan to pull both OpenSSL and jwt-cpp itself from ConanCenter. My
The Since this way of pulling dependencies is platform independent this should also work on Linux. I just tried it in a Ubuntu Docker container and I do get similar errors there (using
I didn't realize this project had a specific test for this, that's very cool! From the snippet you posted it looks like the test is setting |
Perfect amazing. I should be able to repro the problem. Thanks for all the details ❤️ |
Might be that we rely on transient includes from openssl which are no longer included if OPENSSL_NO_DEPRECATED is defined.
which might help to narrow down the issue. |
I looked a bit through the OpenSSL headers and might have an idea of what is happening here. The missing functions the compiler complains about are defined in
As @Thalhammer pointed out setting So my proposed fix for this would be to simply add an explicit include for If you agree with this approach I could prepare a pull request with these changes 🙂. |
Please feel free to try opening a PR! ❤️ I gave it a quick test but it seems there are more deprecated API calls https://github.com/prince-chrismc/jwt-cpp/runs/6382096564?check_suite_focus=true https://www.openssl.org/docs/man3.0/man3/EC_KEY_new.html#HISTORY
|
Thanks a lot! I took a look at the file with the deprecated function calls. If I understand that file correctly it re-defines some OpenSSL functions to be able to change their behavior for testing. But as far as I can tell the re-definitions of the deprecated functions aren't actually needed since the library itself doesn't use them anymore 😄. I also checked the variables used to change their behavior and they seem to also not be used anywhere. So I think the functions can simply be removed. I tried that in a fork, and it looks like all the checks succeeded there: janblome#1. So I also create a PR here: #228. |
Thank you so much for looking deeper into that and getting a PR submitted!!! I triggered the CI and it should be merged soon 🤞 |
Uh oh!
There was an error while loading. Please reload this page.
What happened?
Using OpenSSL 3.0.1 with
OPENSSL_NO_DEPRECATED
defined (as document here) results in compilation errors injwt.h
.How To Reproduce?
Version
0.6.0
What OS are you seeing the problem on?
Windows
What compiler are you seeing the problem on?
MSVC
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: