{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty-tcnative/issues/58","labels_url":"https://api.github.com/repos/netty/netty-tcnative/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty-tcnative/issues/58/comments","events_url":"https://api.github.com/repos/netty/netty-tcnative/issues/58/events","html_url":"https://github.com/netty/netty-tcnative/issues/58","id":104971959,"number":58,"title":"OpenSSL version detection broken ","user":{"login":"nmittler","id":6493296,"avatar_url":"https://avatars.githubusercontent.com/u/6493296?v=3","gravatar_id":"","url":"https://api.github.com/users/nmittler","html_url":"https://github.com/nmittler","followers_url":"https://api.github.com/users/nmittler/followers","following_url":"https://api.github.com/users/nmittler/following{/other_user}","gists_url":"https://api.github.com/users/nmittler/gists{/gist_id}","starred_url":"https://api.github.com/users/nmittler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmittler/subscriptions","organizations_url":"https://api.github.com/users/nmittler/orgs","repos_url":"https://api.github.com/users/nmittler/repos","events_url":"https://api.github.com/users/nmittler/events{/privacy}","received_events_url":"https://api.github.com/users/nmittler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-09-04T21:18:53Z","updated_at":"2015-09-08T14:36:00Z","closed_at":null,"body":"Calling `OpenSsl.version()` seems to result in the version that it was compiled against. I tried building openssl and setting `LD_LIBRARY_PATH`, but it kept returning the same version (1.1.33.Fork6 seems to be built against 1.0.1e). The logic for `OpenSsl.isAlpnSupported()` is based on version, so if it's broken, ALPN support is broken as well.\r\n\r\nIt seems that tc_native is using a macro to get the value: https://github.com/netty/netty-tcnative/blob/be811aeb61eb989724be54f1cb7d9a9969302e27/src/main/c/ssl.c#L273.  I tried switching to using methods:\r\n\r\n```c\r\n// From my local ssl.c...\r\nTCN_IMPLEMENT_CALL(jint, SSL, version)(TCN_STDARGS)\r\n{\r\n    UNREFERENCED_STDARGS;\r\n    fprintf(stderr, \"NM: in new code\");\r\n    return (jint) SSLeay();\r\n}\r\n\r\nTCN_IMPLEMENT_CALL(jstring, SSL, versionString)(TCN_STDARGS)\r\n{\r\n    UNREFERENCED(o);\r\n    fprintf(stderr, \"NM: in new code\");\r\n    return AJP_TO_JSTRING(SSLeay_version(SSLEAY_VERSION));\r\n}\r\n```\r\nHowever I still see the same problem.  I had considered that the method may have been inlined, but it appears that the definition is in a c file (https://github.com/openssl/openssl/blob/6218a1f57e7e25a6b9a798f00cf5f0e56a02ff31/crypto/cversion.c#L104), so that should work.\r\n\r\nAny ideas?\r\n\r\n@Scottmitch @normanmaurer \r\n"},"comment":{"url":"https://api.github.com/repos/netty/netty-tcnative/issues/comments/138584572","html_url":"https://github.com/netty/netty-tcnative/issues/58#issuecomment-138584572","issue_url":"https://api.github.com/repos/netty/netty-tcnative/issues/58","id":138584572,"user":{"login":"nmittler","id":6493296,"avatar_url":"https://avatars.githubusercontent.com/u/6493296?v=3","gravatar_id":"","url":"https://api.github.com/users/nmittler","html_url":"https://github.com/nmittler","followers_url":"https://api.github.com/users/nmittler/followers","following_url":"https://api.github.com/users/nmittler/following{/other_user}","gists_url":"https://api.github.com/users/nmittler/gists{/gist_id}","starred_url":"https://api.github.com/users/nmittler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmittler/subscriptions","organizations_url":"https://api.github.com/users/nmittler/orgs","repos_url":"https://api.github.com/users/nmittler/repos","events_url":"https://api.github.com/users/nmittler/events{/privacy}","received_events_url":"https://api.github.com/users/nmittler/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T14:36:00Z","updated_at":"2015-09-08T14:36:00Z","body":"@normanmaurer I wrote a simple c program and it looks like the change works after all.\r\n\r\n```c\r\n#include <stdio.h>\r\n#include <openssl/crypto.h>\r\n\r\nint main()\r\n{\r\n  printf(\"%ld, %s\\n\", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT);\r\n  printf(\"%ld, %s\\n\", SSLeay(), SSLeay_version(SSLEAY_VERSION));\r\n}\r\n```\r\nWhen built against 1.0.2d but run against 1.0.1p, generates the following:\r\n\r\n```\r\n268443727, OpenSSL 1.0.2d 9 Jul 2015\r\n268439823, OpenSSL 1.0.1p 9 Jul 2015\r\n```\r\n\r\nSo I think we should probably fix this in netty-tcnative and then backport the change (if it still applies) to tcnative.  WDYT?"}}