{"thread":{"id":"52652","subject":"Facing error in git-imap-send while compiling Git","startedAt":"2020-01-16T19:21:20Z","lastAt":"2020-02-15T14:01:02Z","messageCount":14,"participants":["Nirmal Khedkar","Junio C Hamano","Johannes Schindelin","Beat Bolli"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"389910","messageId":"CAFFaXsyVy-fU5c7teDbVCTdUXFTK0GQ=Fse5wSi2vMifyZxS9A@mail.gmail.com","threadId":"52652","inReplyTo":null,"subject":"Facing error in git-imap-send while compiling Git","fromName":"Nirmal Khedkar","fromEmail":"nirmalhk7@gmail.com","sentAt":"2020-01-16T19:20:37Z","receivedAt":"2020-01-16T19:21:20Z","isPatch":false,"sender":{"key":"nirmalhk7@gmail.com","avatar":"https://gravatar.com/avatar/880886fe715992472abdb43dba5bd70d7398b6462cc968b7689e7a70b8c445eb?d=mp&s=160"},"body":"Hey!\nI've been facing this error everytime I run the Makefile:\n-----\nLINK git-imap-send\nimap-send.o: In function `verify_hostname':\n/git/imap-send.c:252: undefined reference to `sk_num'\n/git/imap-send.c:254: undefined reference to `sk_value'\n/git/imap-send.c:260: undefined reference to `sk_pop_free'\n/git/imap-send.c:260: undefined reference to `sk_pop_free'\nimap-send.o: In function `ssl_socket_connect':\n/git/imap-send.c:287: undefined reference to `SSL_library_init'\n/git/imap-send.c:288: undefined reference to `SSL_load_error_strings'\n/git/imap-send.c:290: undefined reference to `SSLv23_method'\ncollect2: error: ld returned 1 exit status\n\nMakefile:2454: recipe for target 'git-imap-send' failed\nmake: *** [git-imap-send] Error 1\n-----\n\nI'm unaware of git imap-send and what it does. I've not done any\nchanges in the above-mentioned files. And now because of this error, I\nreally cant test any changes I've made. It'd be helpful if I could get\nsome guidance on this.\n\nThanks!\nRegards,\nNirmal Khedkar\n"},{"id":"389950","messageId":"xmqqk15rf21d.fsf@gitster-ct.c.googlers.com","threadId":"52652","inReplyTo":"CAFFaXsyVy-fU5c7teDbVCTdUXFTK0GQ=Fse5wSi2vMifyZxS9A@mail.gmail.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-16T22:51:26Z","receivedAt":"2020-01-16T22:51:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nirmal Khedkar <nirmalhk7@gmail.com> writes:\n\n> Hey!\n> I've been facing this error everytime I run the Makefile:\n> -----\n> LINK git-imap-send\n> imap-send.o: In function `verify_hostname':\n> /git/imap-send.c:252: undefined reference to `sk_num'\n\nPerhaps the thread\n\n  https://lore.kernel.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com/\n\nmay help?\n\n"},{"id":"389974","messageId":"CAFFaXsz9LEdegzxL8MhS+VfTs-wmWu+CGDjxjB4Xgj8+7nSHNQ@mail.gmail.com","threadId":"52652","inReplyTo":"xmqqk15rf21d.fsf@gitster-ct.c.googlers.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Nirmal Khedkar","fromEmail":"nirmalhk7@gmail.com","sentAt":"2020-01-17T12:42:12Z","receivedAt":"2020-01-17T12:42:51Z","isPatch":false,"sender":{"key":"nirmalhk7@gmail.com","avatar":"https://gravatar.com/avatar/880886fe715992472abdb43dba5bd70d7398b6462cc968b7689e7a70b8c445eb?d=mp&s=160"},"body":"On Fri, Jan 17, 2020 at 4:21 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Nirmal Khedkar <nirmalhk7@gmail.com> writes:\n>\n> > Hey!\n> > I've been facing this error everytime I run the Makefile:\n> > -----\n> > LINK git-imap-send\n> > imap-send.o: In function `verify_hostname':\n> > /git/imap-send.c:252: undefined reference to `sk_num'\n>\n> Perhaps the thread\n>\n>   https://lore.kernel.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com\n>\n> may help?\n\nIt did, to the extent that I now know why I'm facing these errors out\nof the blue.\n\nI'm  not quite sure as to what am I supposed to do right now, should I\nwait for Liam's patch to be merged,  or should I implement his fixes\nlocally or should I just downgrade my openssl?\n\nLiam's PR (#516 on GitGitGadget [1]) haven't yet passed all build\nchecks and I guess its still a work in progress. Nevertheless I've\ntried implementing his fixes to imap-send.c, and the make still fails.\nAm I missing something here?\n\nThanks!\nRegards,\nNirmal Khedkar\n\n[1] https://github.com/gitgitgadget/git/pull/516\n"},{"id":"389979","messageId":"nycvar.QRO.7.76.6.2001171433180.46@tvgsbejvaqbjf.bet","threadId":"52652","inReplyTo":"CAFFaXsz9LEdegzxL8MhS+VfTs-wmWu+CGDjxjB4Xgj8+7nSHNQ@mail.gmail.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-17T13:35:56Z","receivedAt":"2020-01-17T13:36:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Nirmal,\n\nOn Fri, 17 Jan 2020, Nirmal Khedkar wrote:\n\n> On Fri, Jan 17, 2020 at 4:21 AM Junio C Hamano <gitster@pobox.com> wrote:\n> >\n> > Nirmal Khedkar <nirmalhk7@gmail.com> writes:\n> >\n> > > Hey!\n> > > I've been facing this error everytime I run the Makefile:\n> > > -----\n> > > LINK git-imap-send\n> > > imap-send.o: In function `verify_hostname':\n> > > /git/imap-send.c:252: undefined reference to `sk_num'\n> >\n> > Perhaps the thread\n> >\n> >   https://lore.kernel.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com\n> >\n> > may help?\n>\n> It did, to the extent that I now know why I'm facing these errors out\n> of the blue.\n>\n> I'm  not quite sure as to what am I supposed to do right now, should I\n> wait for Liam's patch to be merged,  or should I implement his fixes\n> locally or should I just downgrade my openssl?\n>\n> Liam's PR (#516 on GitGitGadget [1]) haven't yet passed all build\n> checks and I guess its still a work in progress. Nevertheless I've\n> tried implementing his fixes to imap-send.c, and the make still fails.\n> Am I missing something here?\n\nSpeaking for myself, I am still waiting for\nhttps://public-inbox.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com/\nto be addressed adequately. I think this is the main blocker.\n\nYou could be that person who addresses this, as already 10 days went past\nwithout even so much as an acknowledgement of Junio's suggestion. Maybe\nyou can make it work, and submit a fixed patch (You could take authorship\nand add a footer \"Original-patch-by: Liam Huang <liamhuang0205@gmail.com>\"\nbecause it is most likely a total rewrite of Liam's patch).\n\nCiao,\nJohannes\n"},{"id":"390121","messageId":"CAFFaXsyiLeNPCZ+Kn1x-+0pZf0FiPQR-k8qtooFrdG+VNfLq+g@mail.gmail.com","threadId":"52652","inReplyTo":"nycvar.QRO.7.76.6.2001171433180.46@tvgsbejvaqbjf.bet","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Nirmal Khedkar","fromEmail":"nirmalhk7@gmail.com","sentAt":"2020-01-20T19:12:00Z","receivedAt":"2020-01-20T19:12:39Z","isPatch":false,"sender":{"key":"nirmalhk7@gmail.com","avatar":"https://gravatar.com/avatar/880886fe715992472abdb43dba5bd70d7398b6462cc968b7689e7a70b8c445eb?d=mp&s=160"},"body":"Hey Johannes!\n\nOn Fri, Jan 17, 2020 at 7:05 PM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> Hi Nirmal,\n>\n> On Fri, 17 Jan 2020, Nirmal Khedkar wrote:\n>\n> > On Fri, Jan 17, 2020 at 4:21 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > >\n> > > Nirmal Khedkar <nirmalhk7@gmail.com> writes:\n> > >\n> > > > Hey!\n> > > > I've been facing this error everytime I run the Makefile:\n> > > > -----\n> > > > LINK git-imap-send\n> > > > imap-send.o: In function `verify_hostname':\n> > > > /git/imap-send.c:252: undefined reference to `sk_num'\n> > >\n> > > Perhaps the thread\n> > >\n> > >   https://lore.kernel.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com\n> > >\n> > > may help?\n> >\n> > It did, to the extent that I now know why I'm facing these errors out\n> > of the blue.\n> >\n> > I'm  not quite sure as to what am I supposed to do right now, should I\n> > wait for Liam's patch to be merged,  or should I implement his fixes\n> > locally or should I just downgrade my openssl?\n> >\n> > Liam's PR (#516 on GitGitGadget [1]) haven't yet passed all build\n> > checks and I guess its still a work in progress. Nevertheless I've\n> > tried implementing his fixes to imap-send.c, and the make still fails.\n> > Am I missing something here?\n>\n> Speaking for myself, I am still waiting for\n> https://public-inbox.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com/\n> to be addressed adequately. I think this is the main blocker.\n>\n> You could be that person who addresses this, as already 10 days went past\n> without even so much as an acknowledgement of Junio's suggestion. Maybe\n> you can make it work, and submit a fixed patch (You could take authorship\n> and add a footer \"Original-patch-by: Liam Huang <liamhuang0205@gmail.com>\"\n> because it is most likely a total rewrite of Liam's patch).\n>\n> Ciao,\n> Johannes\n\nThe OpenSSL version on my system is 1.1.1. I've tried implementing\nJunio's suggestions, and it just doesn't work. It gives me the same\nerror as it gave me earlier. Here's the error:\n-----\nLINK git-imap-send\nimap-send.o: In function `verify_hostname':\n/git/imap-send.c:252: undefined reference to `sk_num'\n/git/imap-send.c:254: undefined reference to `sk_value'\n/git/imap-send.c:260: undefined reference to `sk_pop_free'\n/git/imap-send.c:260: undefined reference to `sk_pop_free'\nimap-send.o: In function `ssl_socket_connect':\n/git/imap-send.c:287: undefined reference to `SSL_library_init'\n/git/imap-send.c:288: undefined reference to `SSL_load_error_strings'\n/git/imap-send.c:290: undefined reference to `SSLv23_method'\ncollect2: error: ld returned 1 exit status\n\nMakefile:2454: recipe for target 'git-imap-send' failed\nmake: *** [git-imap-send] Error 1\n-----\n\nFrom my limited understanding of OpenSSL API's, I reckon all these\nerrors might be because of the errors around 'SSL_library_init' and\n'SSL_load_error_strings'. Both these functions are called before\n'verify_hostname' is ever called.\n\nStackOverflow suggested ([1]) to add tags during compilation, but I\ndont think that'd work here.\nWhat should I do? Would love it if you could guide me out.\n\n\nThanks!\nRegards,\nNirmal Khedkar\nhttps://nirmalhk7.github.io\n\n[1] https://stackoverflow.com/questions/5593284/undefined-reference-to-ssl-library-init-and-ssl-load-error-strings\n"},{"id":"390131","messageId":"nycvar.QRO.7.76.6.2001202232460.46@tvgsbejvaqbjf.bet","threadId":"52652","inReplyTo":"CAFFaXsyiLeNPCZ+Kn1x-+0pZf0FiPQR-k8qtooFrdG+VNfLq+g@mail.gmail.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-20T21:35:25Z","receivedAt":"2020-01-20T21:35:33Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 21 Jan 2020, Nirmal Khedkar wrote:\n\n> On Fri, Jan 17, 2020 at 7:05 PM Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > On Fri, 17 Jan 2020, Nirmal Khedkar wrote:\n> >\n> > > On Fri, Jan 17, 2020 at 4:21 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > > >\n> > > > Nirmal Khedkar <nirmalhk7@gmail.com> writes:\n> > > >\n> > > > > Hey!\n> > > > > I've been facing this error everytime I run the Makefile:\n> > > > > -----\n> > > > > LINK git-imap-send\n> > > > > imap-send.o: In function `verify_hostname':\n> > > > > /git/imap-send.c:252: undefined reference to `sk_num'\n> > > >\n> > > > Perhaps the thread\n> > > >\n> > > >   https://lore.kernel.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com\n> > > >\n> > > > may help?\n> > >\n> > > It did, to the extent that I now know why I'm facing these errors out\n> > > of the blue.\n> > >\n> > > I'm  not quite sure as to what am I supposed to do right now, should I\n> > > wait for Liam's patch to be merged,  or should I implement his fixes\n> > > locally or should I just downgrade my openssl?\n> > >\n> > > Liam's PR (#516 on GitGitGadget [1]) haven't yet passed all build\n> > > checks and I guess its still a work in progress. Nevertheless I've\n> > > tried implementing his fixes to imap-send.c, and the make still fails.\n> > > Am I missing something here?\n> >\n> > Speaking for myself, I am still waiting for\n> > https://public-inbox.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com/\n> > to be addressed adequately. I think this is the main blocker.\n> >\n> > You could be that person who addresses this, as already 10 days went past\n> > without even so much as an acknowledgement of Junio's suggestion. Maybe\n> > you can make it work, and submit a fixed patch (You could take authorship\n> > and add a footer \"Original-patch-by: Liam Huang <liamhuang0205@gmail.com>\"\n> > because it is most likely a total rewrite of Liam's patch).\n> >\n> > Ciao,\n> > Johannes\n>\n> The OpenSSL version on my system is 1.1.1. I've tried implementing\n> Junio's suggestions, and it just doesn't work.\n\nDoes the code otherwise compile cleanly with `make DEVELOPER=1`?\n\n> It gives me the same\n> error as it gave me earlier. Here's the error:\n> -----\n> LINK git-imap-send\n> imap-send.o: In function `verify_hostname':\n> /git/imap-send.c:252: undefined reference to `sk_num'\n> /git/imap-send.c:254: undefined reference to `sk_value'\n> /git/imap-send.c:260: undefined reference to `sk_pop_free'\n> /git/imap-send.c:260: undefined reference to `sk_pop_free'\n> imap-send.o: In function `ssl_socket_connect':\n> /git/imap-send.c:287: undefined reference to `SSL_library_init'\n> /git/imap-send.c:288: undefined reference to `SSL_load_error_strings'\n> /git/imap-send.c:290: undefined reference to `SSLv23_method'\n> collect2: error: ld returned 1 exit status\n>\n> Makefile:2454: recipe for target 'git-imap-send' failed\n> make: *** [git-imap-send] Error 1\n> -----\n\nThose are linker errors, meaning that the symbols were not found in the\nlibraries.\n\nIf you build with `make V=1 DEVELOPER=1` you should see that\n`git-imap-send` links in OpenSSL via -lssl (and/or -lcrypto). Is this the\ncase for you?\n\nCiao,\nJohannes\n\n>\n> From my limited understanding of OpenSSL API's, I reckon all these\n> errors might be because of the errors around 'SSL_library_init' and\n> 'SSL_load_error_strings'. Both these functions are called before\n> 'verify_hostname' is ever called.\n>\n> StackOverflow suggested ([1]) to add tags during compilation, but I\n> dont think that'd work here.\n> What should I do? Would love it if you could guide me out.\n>\n>\n> Thanks!\n> Regards,\n> Nirmal Khedkar\n> https://nirmalhk7.github.io\n>\n> [1] https://stackoverflow.com/questions/5593284/undefined-reference-to-ssl-library-init-and-ssl-load-error-strings\n>\n"},{"id":"390167","messageId":"CAFFaXsxLd8duDPTE1H-zJiYnTVSB3pHCfBV+08Y4jLvCWR9kNw@mail.gmail.com","threadId":"52652","inReplyTo":"nycvar.QRO.7.76.6.2001202232460.46@tvgsbejvaqbjf.bet","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Nirmal Khedkar","fromEmail":"nirmalhk7@gmail.com","sentAt":"2020-01-21T11:50:28Z","receivedAt":"2020-01-21T11:51:06Z","isPatch":false,"sender":{"key":"nirmalhk7@gmail.com","avatar":"https://gravatar.com/avatar/880886fe715992472abdb43dba5bd70d7398b6462cc968b7689e7a70b8c445eb?d=mp&s=160"},"body":"Hey Johannes!\n\nOn Tue, Jan 21, 2020 at 3:05 AM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> Hi,\n>\n> On Tue, 21 Jan 2020, Nirmal Khedkar wrote:\n>\n> > On Fri, Jan 17, 2020 at 7:05 PM Johannes Schindelin\n> > <Johannes.Schindelin@gmx.de> wrote:\n> > >\n> > > On Fri, 17 Jan 2020, Nirmal Khedkar wrote:\n> > >\n> > > > On Fri, Jan 17, 2020 at 4:21 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > > > >\n> > > > > Perhaps the thread\n> > > > >\n> > > > >   https://lore.kernel.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com\n> > > > >\n> > > > > may help?\n> > > >\n> > > > It did, to the extent that I now know why I'm facing these errors out\n> > > > of the blue.\n> > > >\n> > > > I'm  not quite sure as to what am I supposed to do right now, should I\n> > > > wait for Liam's patch to be merged,  or should I implement his fixes\n> > > > locally or should I just downgrade my openssl?\n> > > >\n> > > > Liam's PR (#516 on GitGitGadget [1]) haven't yet passed all build\n> > > > checks and I guess its still a work in progress. Nevertheless I've\n> > > > tried implementing his fixes to imap-send.c, and the make still fails.\n> > > > Am I missing something here?\n> > >\n> > > Speaking for myself, I am still waiting for\n> > > https://public-inbox.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com/\n> > > to be addressed adequately. I think this is the main blocker.\n> > >\n> > > You could be that person who addresses this, as already 10 days went past\n> > > without even so much as an acknowledgement of Junio's suggestion. Maybe\n> > > you can make it work, and submit a fixed patch (You could take authorship\n> > > and add a footer \"Original-patch-by: Liam Huang <liamhuang0205@gmail.com>\"\n> > > because it is most likely a total rewrite of Liam's patch).\n> > >\n> > > Ciao,\n> > > Johannes\n> >\n> > The OpenSSL version on my system is 1.1.1. I've tried implementing\n> > Junio's suggestions, and it just doesn't work.\n>\n> Does the code otherwise compile cleanly with `make DEVELOPER=1`?\n>\n> > It gives me the same\n> > error as it gave me earlier.\n> >\n>\n> Those are linker errors, meaning that the symbols were not found in the\n> libraries.\n>\n> If you build with `make V=1 DEVELOPER=1` you should see that\n> `git-imap-send` links in OpenSSL via -lssl (and/or -lcrypto). Is this the\n> case for you?\n\nDoing \"echo DEVELOPER=1 >config.mak\" does not help in any way. I get\nthe same errors. Here's my diff, in case I have been making mistakes\nall along.\n\n\n---\ndiff --git a/imap-send.c b/imap-send.c\nindex 6c54d8c29d..73ed3bc287 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -42,6 +42,12 @@ typedef void *SSL;\n #define USE_CURL_DEFAULT 0\n #endif\n\n+#if OPENSSL_VERSION_NUMBER < 0x10100000L\n+    #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)\n+    #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))\n+    #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))\n+#endif\n+\n static int verbosity;\n static int use_curl = USE_CURL_DEFAULT;\n\n@@ -59,6 +65,8 @@ static struct option imap_send_options[] = {\n #define DRV_BOX_BAD     -2\n #define DRV_STORE_BAD   -3\n---\n\nFrom my limited knowledge of OpenSSL libraries, I think the error has\nmore to do with 'SSL_library_init()' , which appears like a\nconstructor to the OpenSSL library. I found these emails regarding\n\"if\" cases around this function. Please check out these patches:\n1. Rosen Penev:\nhttps://lore.kernel.org/git/20181227023548.396-1-rosenp@gmail.com/\n2. eroen: https://lore.kernel.org/git/20170112104219.563497-1-git-scm@occam.eroen.eu/\n\nAre the fixes made in these patches relevant here. Please let me know\nif I'm going wrong.\n\nThanks!\nNirmal Khedkar\nhttps://nirmalhk7.github.io\n"},{"id":"390186","messageId":"xmqqa76gbrxm.fsf@gitster-ct.c.googlers.com","threadId":"52652","inReplyTo":"CAFFaXsxLd8duDPTE1H-zJiYnTVSB3pHCfBV+08Y4jLvCWR9kNw@mail.gmail.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-21T18:11:33Z","receivedAt":"2020-01-21T18:11:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nirmal Khedkar <nirmalhk7@gmail.com> writes:\n\n> the same errors. Here's my diff, in case I have been making mistakes\n> all along.\n>\n>\n> ---\n> diff --git a/imap-send.c b/imap-send.c\n> index 6c54d8c29d..73ed3bc287 100644\n> --- a/imap-send.c\n> +++ b/imap-send.c\n> @@ -42,6 +42,12 @@ typedef void *SSL;\n>  #define USE_CURL_DEFAULT 0\n>  #endif\n>\n> +#if OPENSSL_VERSION_NUMBER < 0x10100000L\n> +    #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)\n> +    #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))\n> +    #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))\n> +#endif\n> +\n>  static int verbosity;\n>  static int use_curl = USE_CURL_DEFAULT;\n>\n> @@ -59,6 +65,8 @@ static struct option imap_send_options[] = {\n>  #define DRV_BOX_BAD     -2\n>  #define DRV_STORE_BAD   -3\n> ---\n\nIf the above is the whole change, then I do not think it would\nwork.  In the thread I referred you to, I was responding to a patch\nthat has repetitive \n\n\t+#if OPENSSL_VERSION_NUMBER < 0x10100000L\n\t\tcall_this_original_function();\n\t+#else\n\t+\tcall_this_new_function();\n\t+#endif\n\nand I was merely suggesting to reduce the patch noise by #define'ing\na compatibility macro to allow us use new names in the code regardless\nof the version (i.e. OPENSSL_sk_*() may not be available in older\nversion, which used to call them sk_*()---the solution is to pretend\nwe have OPENSSL_sk_*() by defining them in terms of sk_*() we do have).\n\nThere was a hunk (or perhaps two) in the patch I was responding to\nthat is different from the mere function renaming.  That part is not\nthere in the above patch you pasted, and needs to be kept, I think.\n\n"},{"id":"390203","messageId":"nycvar.QRO.7.76.6.2001212144560.46@tvgsbejvaqbjf.bet","threadId":"52652","inReplyTo":"CAFFaXsxLd8duDPTE1H-zJiYnTVSB3pHCfBV+08Y4jLvCWR9kNw@mail.gmail.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-21T21:09:07Z","receivedAt":"2020-01-21T21:09:11Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 21 Jan 2020, Nirmal Khedkar wrote:\n\n> On Tue, Jan 21, 2020 at 3:05 AM Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > On Tue, 21 Jan 2020, Nirmal Khedkar wrote:\n> >\n> > > On Fri, Jan 17, 2020 at 7:05 PM Johannes Schindelin\n> > > <Johannes.Schindelin@gmx.de> wrote:\n> > > >\n> > > > On Fri, 17 Jan 2020, Nirmal Khedkar wrote:\n> > > >\n> > > > > On Fri, Jan 17, 2020 at 4:21 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > > > > >\n> > > > > > Perhaps the thread\n> > > > > >\n> > > > > >   https://lore.kernel.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com\n> > > > > >\n> > > > > > may help?\n> > > > >\n> > > > > It did, to the extent that I now know why I'm facing these errors out\n> > > > > of the blue.\n> > > > >\n> > > > > I'm  not quite sure as to what am I supposed to do right now, should I\n> > > > > wait for Liam's patch to be merged,  or should I implement his fixes\n> > > > > locally or should I just downgrade my openssl?\n> > > > >\n> > > > > Liam's PR (#516 on GitGitGadget [1]) haven't yet passed all build\n> > > > > checks and I guess its still a work in progress. Nevertheless I've\n> > > > > tried implementing his fixes to imap-send.c, and the make still fails.\n> > > > > Am I missing something here?\n> > > >\n> > > > Speaking for myself, I am still waiting for\n> > > > https://public-inbox.org/git/xmqqpnfv3tq4.fsf@gitster-ct.c.googlers.com/\n> > > > to be addressed adequately. I think this is the main blocker.\n> > > >\n> > > > You could be that person who addresses this, as already 10 days went past\n> > > > without even so much as an acknowledgement of Junio's suggestion. Maybe\n> > > > you can make it work, and submit a fixed patch (You could take authorship\n> > > > and add a footer \"Original-patch-by: Liam Huang <liamhuang0205@gmail.com>\"\n> > > > because it is most likely a total rewrite of Liam's patch).\n> > > >\n> > > > Ciao,\n> > > > Johannes\n> > >\n> > > The OpenSSL version on my system is 1.1.1. I've tried implementing\n> > > Junio's suggestions, and it just doesn't work.\n> >\n> > Does the code otherwise compile cleanly with `make DEVELOPER=1`?\n> >\n> > > It gives me the same\n> > > error as it gave me earlier.\n> > >\n> >\n> > Those are linker errors, meaning that the symbols were not found in the\n> > libraries.\n> >\n> > If you build with `make V=1 DEVELOPER=1` you should see that\n> > `git-imap-send` links in OpenSSL via -lssl (and/or -lcrypto). Is this the\n> > case for you?\n>\n> Doing \"echo DEVELOPER=1 >config.mak\" does not help in any way. I get\n> the same errors. Here's my diff, in case I have been making mistakes\n> all along.\n>\n>\n> ---\n> diff --git a/imap-send.c b/imap-send.c\n> index 6c54d8c29d..73ed3bc287 100644\n> --- a/imap-send.c\n> +++ b/imap-send.c\n> @@ -42,6 +42,12 @@ typedef void *SSL;\n>  #define USE_CURL_DEFAULT 0\n>  #endif\n>\n> +#if OPENSSL_VERSION_NUMBER < 0x10100000L\n> +    #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)\n> +    #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))\n> +    #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))\n> +#endif\n\nThat looks sensible.\n\n> +\n>  static int verbosity;\n>  static int use_curl = USE_CURL_DEFAULT;\n>\n> @@ -59,6 +65,8 @@ static struct option imap_send_options[] = {\n>  #define DRV_BOX_BAD     -2\n>  #define DRV_STORE_BAD   -3\n> ---\n>\n> From my limited knowledge of OpenSSL libraries, I think the error has\n> more to do with 'SSL_library_init()' , which appears like a\n> constructor to the OpenSSL library. I found these emails regarding\n> \"if\" cases around this function. Please check out these patches:\n> 1. Rosen Penev:\n> https://lore.kernel.org/git/20181227023548.396-1-rosenp@gmail.com/\n\nI remember that one. And I agreed with Junio that the documentation\nsuggests that the call is _optional_, while the patch suggests that it\nwould be _incorrect_ instead.\n\nAnd looking at\nhttps://www.openssl.org/docs/man1.1.1/man3/SSL_library_init.html suggests\nto me that it is still supported.\n\nHaving said that, if I look at the headers installed for `libssl-dev`\nversion `1.1.1-1ubuntu2.1~18.04.5` in my Ubuntu installation, I see that\n`/usr/include/openssl/ssl.h` defines that symbol as:\n\n\t#  define SSL_library_init() OPENSSL_init_ssl(0, NULL)\n\nbut _only_:\n\n\t# if OPENSSL_API_COMPAT < 0x10100000L\n\nSo maybe that disagrees with the documentation that says that\nSSL_library_init() is optional?\n\nThe curious thing is that `OPENSSL_API_COMPAT` is not even defined\nanywhere. So maybe it _is_ the right thing to also `#define\nSSL_library_init() (void)` in the diff you listed above?\n\n_Maybe_ guarded within `#ifndef SSL_library_init ... #endif` guards?\n\n> 2. eroen: https://lore.kernel.org/git/20170112104219.563497-1-git-scm@occam.eroen.eu/\n\nThat sounds like a good suggestion, too.\n\n> Are the fixes made in these patches relevant here. Please let me know\n> if I'm going wrong.\n\nYes, both threads are relevant, and if you can reconcile them into a patch\nthat makes Git compile with OpenSSL v1.1.1, I will try my best to review\nthem (Cc: me, just in case).\n\nCiao,\nJohannes\n"},{"id":"390238","messageId":"xmqqmuaf70xx.fsf@gitster-ct.c.googlers.com","threadId":"52652","inReplyTo":"nycvar.QRO.7.76.6.2001212144560.46@tvgsbejvaqbjf.bet","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-22T19:20:26Z","receivedAt":"2020-01-22T19:20:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> From my limited knowledge of OpenSSL libraries, I think the error has\n>> more to do with 'SSL_library_init()' , which appears like a\n>> constructor to the OpenSSL library. I found these emails regarding\n>> \"if\" cases around this function. Please check out these patches:\n>> 1. Rosen Penev:\n>> https://lore.kernel.org/git/20181227023548.396-1-rosenp@gmail.com/\n>\n> I remember that one. And I agreed with Junio that the documentation\n> suggests that the call is _optional_, while the patch suggests that it\n> would be _incorrect_ instead.\n>\n> And looking at\n> https://www.openssl.org/docs/man1.1.1/man3/SSL_library_init.html suggests\n> to me that it is still supported.\n>\n> Having said that, if I look at the headers installed for `libssl-dev`\n> version `1.1.1-1ubuntu2.1~18.04.5` in my Ubuntu installation, I see that\n> `/usr/include/openssl/ssl.h` defines that symbol as:\n>\n> \t#  define SSL_library_init() OPENSSL_init_ssl(0, NULL)\n>\n> but _only_:\n>\n> \t# if OPENSSL_API_COMPAT < 0x10100000L\n>\n> So maybe that disagrees with the documentation that says that\n> SSL_library_init() is optional?\n>\n> The curious thing is that `OPENSSL_API_COMPAT` is not even defined\n> anywhere. So maybe it _is_ the right thing to also `#define\n> SSL_library_init() (void)` in the diff you listed above?\n>\n> _Maybe_ guarded within `#ifndef SSL_library_init ... #endif` guards?\n>\n>> 2. eroen: https://lore.kernel.org/git/20170112104219.563497-1-git-scm@occam.eroen.eu/\n>\n> That sounds like a good suggestion, too.\n>\n>> Are the fixes made in these patches relevant here. Please let me know\n>> if I'm going wrong.\n>\n> Yes, both threads are relevant, and if you can reconcile them into a patch\n> that makes Git compile with OpenSSL v1.1.1, I will try my best to review\n> them (Cc: me, just in case).\n\nI agree with the above reasoning and the suggestion given by Bates in\nhttps://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/\nsounds like a reasonable one.\n\nThanks for digging and double-checking these two previous efforts,\nand giving another round of thoughts on them.  \n\n\n\n\n"},{"id":"390835","messageId":"CAFFaXsxeyxkPwAYSs=TEzd8fsa5r9KpJ7q8PX0ehNJ1Wpai4fA@mail.gmail.com","threadId":"52652","inReplyTo":"xmqqmuaf70xx.fsf@gitster-ct.c.googlers.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Nirmal Khedkar","fromEmail":"nirmalhk7@gmail.com","sentAt":"2020-01-30T20:26:35Z","receivedAt":"2020-01-30T20:27:13Z","isPatch":false,"sender":{"key":"nirmalhk7@gmail.com","avatar":"https://gravatar.com/avatar/880886fe715992472abdb43dba5bd70d7398b6462cc968b7689e7a70b8c445eb?d=mp&s=160"},"body":"Hi All,\nI'll admit I'm quite perplexed with this OpenSSL problem that I'm\nfacing. Here's what I've done along with their results:\n1. eroen and Jack Bates' suggestions\n(https://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/)\n2. I've also implemented Johannes' suggestions, and I'm still facing\nthe same problem.Here's the final diff:\n---\ndiff --git a/imap-send.c b/imap-send.c\nindex 6c54d8c29d..3248bc2123 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -41,7 +41,9 @@ typedef void *SSL;\n /* We don't have curl, so continue to use the historical implementation */\n #define USE_CURL_DEFAULT 0\n #endif\n-\n+#ifndef SSL_library_init\n+       #define SSL_library_init();\n+#endif\n static int verbosity;\n static int use_curl = USE_CURL_DEFAULT;\n\n@@ -59,6 +61,13 @@ static struct option imap_send_options[] = {\n #define DRV_BOX_BAD     -2\n #define DRV_STORE_BAD   -3\n\n+\n+#if OPENSSL_VERSION_NUMBER < 0x10100000L\n+       #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)\n+       #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))\n+       #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))\n+#endif\n+\n __attribute__((format (printf, 1, 2)))\n static void imap_info(const char *, ...);\n __attribute__((format (printf, 1, 2)))\n@@ -275,21 +284,30 @@ static int verify_hostname(X509 *cert, const\nchar *hostname)\n\n static int ssl_socket_connect(struct imap_socket *sock, int\nuse_tls_only, int verify)\n {\n-#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)\n-       const SSL_METHOD *meth;\n-#else\n-       SSL_METHOD *meth;\n-#endif\n-       SSL_CTX *ctx;\n-       int ret;\n-       X509 *cert;\n-\n-       SSL_library_init();\n-       SSL_load_error_strings();\n+       #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)\n+               const SSL_METHOD *meth;\n+       #else\n+               SSL_METHOD *meth;\n+       #endif\n+               SSL_CTX *ctx;\n+               int ret;\n+               X509 *cert;\n+\n+       #if OPENSSL_VERSION_NUMBER >= 0x10100000L ||\ndefined(LIBRESSL_VERSION_NUMBER)\n+               OPENSSL_init_ssl(0, NULL);\n+               meth = TLS_method();\n+       #else\n+               SSL_library_init();\n+               SSL_load_error_strings();\n+               meth = SSLv23_method();\n+       #endif\n\n-       meth = SSLv23_method();\n        if (!meth) {\n-               ssl_socket_perror(\"SSLv23_method\");\n+       #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n+                       ssl_socket_perror(\"TLS_method\");\n+       #else\n+                       ssl_socket_perror(\"SSLv23_method\");\n+       #endif\n                return -1;\n        }\n\n\n---\n\nAlso, on a different note: I'm actually really interested in applying\nto Git for GSoC, and I should be doing Git microprojects right now to\nproperly cement my chance of doing GSoC with Git. Many aspiring GSoC\napplicants already been asking, enquiring and maybe even working about\nGit microprojects, as evident from the mailing list.\n\nSo while I'm not saying that I'm in deep trouble and all this OpenSSL\nv1.1.1 issue fixing is completely useless (I'm learning quite a lot\nalong the way and able to understand the project structure), but\nsaying that I'm not worried about my GSoC prospects of working in this\norganization would honestly be false :) . I love git, I would love\ncontributing to Git, but I'd love to do a GSoC Summer with Git much\nmore than the rest.\n\nPlease let me know where am I going wrong. If there's any other system\npackages that I can download so that I can focus on other Git issues\nand this one simultaneously, please let me know. Here are my system\nspecifications (let me know if you need anything more specific):\n---\nOS: Ubuntu 18.04\nLinux Kernel: 5.3\nOpenSSL Version: 1.1.1d\n---\n\nApologies for the long email,\nThank You,\nNirmal Khedkar\n(https://nirmalhk7.github.io)\n\n\nOn Thu, Jan 23, 2020 at 12:50 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> From my limited knowledge of OpenSSL libraries, I think the error has\n> >> more to do with 'SSL_library_init()' , which appears like a\n> >> constructor to the OpenSSL library. I found these emails regarding\n> >> \"if\" cases around this function. Please check out these patches:\n> >> 1. Rosen Penev:\n> >> https://lore.kernel.org/git/20181227023548.396-1-rosenp@gmail.com/\n> >\n> > I remember that one. And I agreed with Junio that the documentation\n> > suggests that the call is _optional_, while the patch suggests that it\n> > would be _incorrect_ instead.\n> >\n> > And looking at\n> > https://www.openssl.org/docs/man1.1.1/man3/SSL_library_init.html suggests\n> > to me that it is still supported.\n> >\n> > Having said that, if I look at the headers installed for `libssl-dev`\n> > version `1.1.1-1ubuntu2.1~18.04.5` in my Ubuntu installation, I see that\n> > `/usr/include/openssl/ssl.h` defines that symbol as:\n> >\n> >       #  define SSL_library_init() OPENSSL_init_ssl(0, NULL)\n> >\n> > but _only_:\n> >\n> >       # if OPENSSL_API_COMPAT < 0x10100000L\n> >\n> > So maybe that disagrees with the documentation that says that\n> > SSL_library_init() is optional?\n> >\n> > The curious thing is that `OPENSSL_API_COMPAT` is not even defined\n> > anywhere. So maybe it _is_ the right thing to also `#define\n> > SSL_library_init() (void)` in the diff you listed above?\n> >\n> > _Maybe_ guarded within `#ifndef SSL_library_init ... #endif` guards?\n> >\n> >> 2. eroen: https://lore.kernel.org/git/20170112104219.563497-1-git-scm@occam.eroen.eu/\n> >\n> > That sounds like a good suggestion, too.\n> >\n> >> Are the fixes made in these patches relevant here. Please let me know\n> >> if I'm going wrong.\n> >\n> > Yes, both threads are relevant, and if you can reconcile them into a patch\n> > that makes Git compile with OpenSSL v1.1.1, I will try my best to review\n> > them (Cc: me, just in case).\n>\n> I agree with the above reasoning and the suggestion given by Bates in\n> https://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/\n> sounds like a reasonable one.\n>\n> Thanks for digging and double-checking these two previous efforts,\n> and giving another round of thoughts on them.\n>\n>\n>\n>\n"},{"id":"390873","messageId":"ef341b26-a10f-9194-6c76-ae6ddfd7981a@drbeat.li","threadId":"52652","inReplyTo":"CAFFaXsxeyxkPwAYSs=TEzd8fsa5r9KpJ7q8PX0ehNJ1Wpai4fA@mail.gmail.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2020-01-30T23:03:08Z","receivedAt":"2020-01-30T23:15:01Z","isPatch":false,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"Hi Nirmal!\n\nOn 30.01.20 21:26, Nirmal Khedkar wrote:\n> Hi All,\n> I'll admit I'm quite perplexed with this OpenSSL problem that I'm\n> facing. Here's what I've done along with their results:\n\n... snipped ...\n\n> Please let me know where am I going wrong. If there's any other system\n> packages that I can download so that I can focus on other Git issues\n> and this one simultaneously, please let me know. Here are my system\n> specifications (let me know if you need anything more specific):\n> ---\n> OS: Ubuntu 18.04\n> Linux Kernel: 5.3\n> OpenSSL Version: 1.1.1d\n> ---\n> \n> Apologies for the long email,\n> Thank You,\n\nNo problem!\n\nMy system is similar: Debian testing with the OpenSSL 1.1.1d from the\ndistribution. I have no build problems whatsoever. OpenSSL comes with\nbackward compatibility macros that most allow code written for 1.0.2 to\nbe compiled without errors. These macros can be turned off by changing\nthe API compatibility version using -DOPENSSL_API_COMPAT=<version>.\n\nYou can check this with\n\n    make V=1 imap-send.o\n\nThis will show the compiler command executed:\n\n    gcc -o imap-send.o -c -MF ./.depend/imap-send.o.d -MQ imap-send.o\n-MMD -MP   -g -O2 -I. -DHAVE_SYSINFO -DGIT_HOST_CPU=\"\\\"x86_64\\\"\"\n-DHAVE_ALLOCA_H -DUSE_CURL_FOR_IMAP_SEND -DSHA1_DC\n-DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0\n-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"cache.h\\\"\"\n-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\" -DSHA256_BLK\n-pthread -DHAVE_PATHS_H -DHAVE_STRINGS_H -DHAVE_DEV_TTY\n-DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_GETDELIM\n'-DPROCFS_EXECUTABLE_PATH=\"/proc/self/exe\"'  -DFREAD_READS_DIRECTORIES\n-DNO_STRLCPY -DSHELL_PATH='\"/bin/sh\"' -DPAGER_ENV='\"LESS=FRX LV=-c\"'\nimap-send.c\n\nCheck it for any -D flags mentioning OpenSSL.\n\nYou can get even more verbose output from gcc by copying the compiler\ncommand make displays and running it after appending the verbose flag\n\"-v\" at the end.\n\nCheck this new output for include directories etc. You need to make sure\nthat gcc picks up the system OpenSSL include files. They should be found\nunder /usr/include/openssl.\n\n\nHope this helps,\n\nBeat Bolli\n"},{"id":"391001","messageId":"nycvar.QRO.7.76.6.2002012229480.46@tvgsbejvaqbjf.bet","threadId":"52652","inReplyTo":"CAFFaXsxeyxkPwAYSs=TEzd8fsa5r9KpJ7q8PX0ehNJ1Wpai4fA@mail.gmail.com","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-02-01T21:35:08Z","receivedAt":"2020-02-01T21:35:15Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Nirmal,\n\nOn Fri, 31 Jan 2020, Nirmal Khedkar wrote:\n\n> I'll admit I'm quite perplexed with this OpenSSL problem that I'm\n> facing. Here's what I've done along with their results:\n> 1. eroen and Jack Bates' suggestions\n> (https://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/)\n> 2. I've also implemented Johannes' suggestions, and I'm still facing\n> the same problem.\n\nCould you repeat the symptoms? I forgot the details since you posted your\nprevious email.\n\n> Here's the final diff:\n> ---\n> diff --git a/imap-send.c b/imap-send.c\n> index 6c54d8c29d..3248bc2123 100644\n> --- a/imap-send.c\n> +++ b/imap-send.c\n> @@ -41,7 +41,9 @@ typedef void *SSL;\n>  /* We don't have curl, so continue to use the historical implementation */\n>  #define USE_CURL_DEFAULT 0\n>  #endif\n> -\n> +#ifndef SSL_library_init\n> +       #define SSL_library_init();\n> +#endif\n>  static int verbosity;\n>  static int use_curl = USE_CURL_DEFAULT;\n>\n> @@ -59,6 +61,13 @@ static struct option imap_send_options[] = {\n>  #define DRV_BOX_BAD     -2\n>  #define DRV_STORE_BAD   -3\n>\n> +\n> +#if OPENSSL_VERSION_NUMBER < 0x10100000L\n> +       #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)\n> +       #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))\n> +       #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))\n> +#endif\n> +\n>  __attribute__((format (printf, 1, 2)))\n>  static void imap_info(const char *, ...);\n>  __attribute__((format (printf, 1, 2)))\n> @@ -275,21 +284,30 @@ static int verify_hostname(X509 *cert, const\n> char *hostname)\n>\n>  static int ssl_socket_connect(struct imap_socket *sock, int\n> use_tls_only, int verify)\n>  {\n> -#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)\n> -       const SSL_METHOD *meth;\n> -#else\n> -       SSL_METHOD *meth;\n> -#endif\n> -       SSL_CTX *ctx;\n> -       int ret;\n> -       X509 *cert;\n> -\n> -       SSL_library_init();\n> -       SSL_load_error_strings();\n> +       #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)\n> +               const SSL_METHOD *meth;\n> +       #else\n> +               SSL_METHOD *meth;\n> +       #endif\n> +               SSL_CTX *ctx;\n> +               int ret;\n> +               X509 *cert;\n> +\n> +       #if OPENSSL_VERSION_NUMBER >= 0x10100000L ||\n> defined(LIBRESSL_VERSION_NUMBER)\n> +               OPENSSL_init_ssl(0, NULL);\n> +               meth = TLS_method();\n> +       #else\n> +               SSL_library_init();\n> +               SSL_load_error_strings();\n> +               meth = SSLv23_method();\n> +       #endif\n>\n> -       meth = SSLv23_method();\n>         if (!meth) {\n> -               ssl_socket_perror(\"SSLv23_method\");\n> +       #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n> +                       ssl_socket_perror(\"TLS_method\");\n> +       #else\n> +                       ssl_socket_perror(\"SSLv23_method\");\n> +       #endif\n>                 return -1;\n>         }\n>\n>\n> ---\n\nThat diff looks pretty okay to me.\n\n> Also, on a different note: I'm actually really interested in applying\n> to Git for GSoC, and I should be doing Git microprojects right now to\n> properly cement my chance of doing GSoC with Git. Many aspiring GSoC\n> applicants already been asking, enquiring and maybe even working about\n> Git microprojects, as evident from the mailing list.\n\nFor the record, I am not even sure whether Git will participate in GSoC\nthis year; I am not aware of any activity in that direction.\n\nHaving said that, the purpose of a Git microproject is to get acquainted\nwith the development process of Git (at least in my mind). It is not so\nmuch fixing some issue in Git, but more like learning how to interact with\nthe Git mailing list, in particular how to communicate effectively with\nthe developers/reviewers on this list.\n\nIn that light, if I were a possible mentor (which I am not, at least not\nin this year's GSoC) I would not insist on a microproject. Or more like: I\nwould accept your work on getting this vexing OpenSSL v1.1.1 issue sorted\nout as a microproject in its own right.\n\n> So while I'm not saying that I'm in deep trouble and all this OpenSSL\n> v1.1.1 issue fixing is completely useless (I'm learning quite a lot\n> along the way and able to understand the project structure), but\n> saying that I'm not worried about my GSoC prospects of working in this\n> organization would honestly be false :) . I love git, I would love\n> contributing to Git, but I'd love to do a GSoC Summer with Git much\n> more than the rest.\n>\n> Please let me know where am I going wrong. If there's any other system\n> packages that I can download so that I can focus on other Git issues\n> and this one simultaneously, please let me know. Here are my system\n> specifications (let me know if you need anything more specific):\n> ---\n> OS: Ubuntu 18.04\n> Linux Kernel: 5.3\n> OpenSSL Version: 1.1.1d\n> ---\n>\n> Apologies for the long email,\n\nThis is not even close to being the longest email sent to this list, so\ndon't worry!\n\nCiao,\nJohannes\n\n> Thank You,\n> Nirmal Khedkar\n> (https://nirmalhk7.github.io)\n>\n>\n> On Thu, Jan 23, 2020 at 12:50 AM Junio C Hamano <gitster@pobox.com> wrote:\n> >\n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> >\n> > >> From my limited knowledge of OpenSSL libraries, I think the error has\n> > >> more to do with 'SSL_library_init()' , which appears like a\n> > >> constructor to the OpenSSL library. I found these emails regarding\n> > >> \"if\" cases around this function. Please check out these patches:\n> > >> 1. Rosen Penev:\n> > >> https://lore.kernel.org/git/20181227023548.396-1-rosenp@gmail.com/\n> > >\n> > > I remember that one. And I agreed with Junio that the documentation\n> > > suggests that the call is _optional_, while the patch suggests that it\n> > > would be _incorrect_ instead.\n> > >\n> > > And looking at\n> > > https://www.openssl.org/docs/man1.1.1/man3/SSL_library_init.html suggests\n> > > to me that it is still supported.\n> > >\n> > > Having said that, if I look at the headers installed for `libssl-dev`\n> > > version `1.1.1-1ubuntu2.1~18.04.5` in my Ubuntu installation, I see that\n> > > `/usr/include/openssl/ssl.h` defines that symbol as:\n> > >\n> > >       #  define SSL_library_init() OPENSSL_init_ssl(0, NULL)\n> > >\n> > > but _only_:\n> > >\n> > >       # if OPENSSL_API_COMPAT < 0x10100000L\n> > >\n> > > So maybe that disagrees with the documentation that says that\n> > > SSL_library_init() is optional?\n> > >\n> > > The curious thing is that `OPENSSL_API_COMPAT` is not even defined\n> > > anywhere. So maybe it _is_ the right thing to also `#define\n> > > SSL_library_init() (void)` in the diff you listed above?\n> > >\n> > > _Maybe_ guarded within `#ifndef SSL_library_init ... #endif` guards?\n> > >\n> > >> 2. eroen: https://lore.kernel.org/git/20170112104219.563497-1-git-scm@occam.eroen.eu/\n> > >\n> > > That sounds like a good suggestion, too.\n> > >\n> > >> Are the fixes made in these patches relevant here. Please let me know\n> > >> if I'm going wrong.\n> > >\n> > > Yes, both threads are relevant, and if you can reconcile them into a patch\n> > > that makes Git compile with OpenSSL v1.1.1, I will try my best to review\n> > > them (Cc: me, just in case).\n> >\n> > I agree with the above reasoning and the suggestion given by Bates in\n> > https://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/\n> > sounds like a reasonable one.\n> >\n> > Thanks for digging and double-checking these two previous efforts,\n> > and giving another round of thoughts on them.\n> >\n> >\n> >\n> >\n>\n"},{"id":"391830","messageId":"CAFFaXsztYtNtWeEMgkjYcZ-0_bcywGo5zFV0vwg6UjtXCx1ocw@mail.gmail.com","threadId":"52652","inReplyTo":"nycvar.QRO.7.76.6.2002012229480.46@tvgsbejvaqbjf.bet","subject":"Re: Facing error in git-imap-send while compiling Git","fromName":"Nirmal Khedkar","fromEmail":"nirmalhk7@gmail.com","sentAt":"2020-02-15T14:00:18Z","receivedAt":"2020-02-15T14:01:02Z","isPatch":false,"sender":{"key":"nirmalhk7@gmail.com","avatar":"https://gravatar.com/avatar/880886fe715992472abdb43dba5bd70d7398b6462cc968b7689e7a70b8c445eb?d=mp&s=160"},"body":"Hi All!\nApologies for late reply, had examinations for past week.\n\nOn Sun, Feb 2, 2020 at 3:05 AM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> Hi Nirmal,\n>\n> On Fri, 31 Jan 2020, Nirmal Khedkar wrote:\n>\n> > I'll admit I'm quite perplexed with this OpenSSL problem that I'm\n> > facing. Here's what I've done along with their results:\n> > 1. eroen and Jack Bates' suggestions\n> > (https://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/)\n> > 2. I've also implemented Johannes' suggestions, and I'm still facing\n> > the same problem.\n>\n> Could you repeat the symptoms? I forgot the details since you posted your\n> previous email.\n\nHere's the latest errors:\n---\n    LINK git-imap-send\nimap-send.o: In function `verify_hostname':\nimap-send.c:261: undefined reference to `sk_num'\nimap-send.c:263: undefined reference to `sk_value'\nimap-send.c:269: undefined reference to `sk_pop_free'\nimap-send.c:269: undefined reference to `sk_pop_free'\nimap-send.o: In function `ssl_socket_connect':\nimap-send.c:301: undefined reference to `SSL_load_error_strings'\nimap-send.c:302: undefined reference to `SSLv23_method'\ncollect2: error: ld returned 1 exit status\nMakefile:2454: recipe for target 'git-imap-send' failed\nmake: *** [git-imap-send] Error 1\n---\n\nI was kind-of hoping that when I switch from Linux 5.3 Edge to Linux\n5.3 (Which came about a week ago), these issues would disappear, but\nthey still exist.\n\nI've also tried Beat Bolli's suggestion, but I get *no output* when I\nrun \"make V=1 imap-send.o\". I dont understand why either.\n\nMy previous emails have already mentioned this: I seriously want to\napply to Git. Its a serious component to all my projects and pretty\nsure for everyone else's too, and contributing to Git gives me the\n_contributing-back-to-society_ vibes which I like :)\n\nSo I'd love if someone could break down to me (who's never worked with\nOpenSSL) on what imap-send does (in words simpler than ones in\nmanpages). I think only if I understand OpenSSL better, will I be able\nto fix this issue.\n\nThanks a lot!\nRegards,\nNirmal Khedkar\n\n--\nNirmal Khedkar\nhttps://nirmalhk7.github.io\nGithub: www.github.com/nirmalhk7\n\n\n\nOn Sun, Feb 2, 2020 at 3:05 AM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> Hi Nirmal,\n>\n> On Fri, 31 Jan 2020, Nirmal Khedkar wrote:\n>\n> > I'll admit I'm quite perplexed with this OpenSSL problem that I'm\n> > facing. Here's what I've done along with their results:\n> > 1. eroen and Jack Bates' suggestions\n> > (https://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/)\n> > 2. I've also implemented Johannes' suggestions, and I'm still facing\n> > the same problem.\n>\n> Could you repeat the symptoms? I forgot the details since you posted your\n> previous email.\n>\n> > Here's the final diff:\n> > ---\n> > diff --git a/imap-send.c b/imap-send.c\n> > index 6c54d8c29d..3248bc2123 100644\n> > --- a/imap-send.c\n> > +++ b/imap-send.c\n> > @@ -41,7 +41,9 @@ typedef void *SSL;\n> >  /* We don't have curl, so continue to use the historical implementation */\n> >  #define USE_CURL_DEFAULT 0\n> >  #endif\n> > -\n> > +#ifndef SSL_library_init\n> > +       #define SSL_library_init();\n> > +#endif\n> >  static int verbosity;\n> >  static int use_curl = USE_CURL_DEFAULT;\n> >\n> > @@ -59,6 +61,13 @@ static struct option imap_send_options[] = {\n> >  #define DRV_BOX_BAD     -2\n> >  #define DRV_STORE_BAD   -3\n> >\n> > +\n> > +#if OPENSSL_VERSION_NUMBER < 0x10100000L\n> > +       #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)\n> > +       #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))\n> > +       #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))\n> > +#endif\n> > +\n> >  __attribute__((format (printf, 1, 2)))\n> >  static void imap_info(const char *, ...);\n> >  __attribute__((format (printf, 1, 2)))\n> > @@ -275,21 +284,30 @@ static int verify_hostname(X509 *cert, const\n> > char *hostname)\n> >\n> >  static int ssl_socket_connect(struct imap_socket *sock, int\n> > use_tls_only, int verify)\n> >  {\n> > -#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)\n> > -       const SSL_METHOD *meth;\n> > -#else\n> > -       SSL_METHOD *meth;\n> > -#endif\n> > -       SSL_CTX *ctx;\n> > -       int ret;\n> > -       X509 *cert;\n> > -\n> > -       SSL_library_init();\n> > -       SSL_load_error_strings();\n> > +       #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)\n> > +               const SSL_METHOD *meth;\n> > +       #else\n> > +               SSL_METHOD *meth;\n> > +       #endif\n> > +               SSL_CTX *ctx;\n> > +               int ret;\n> > +               X509 *cert;\n> > +\n> > +       #if OPENSSL_VERSION_NUMBER >= 0x10100000L ||\n> > defined(LIBRESSL_VERSION_NUMBER)\n> > +               OPENSSL_init_ssl(0, NULL);\n> > +               meth = TLS_method();\n> > +       #else\n> > +               SSL_library_init();\n> > +               SSL_load_error_strings();\n> > +               meth = SSLv23_method();\n> > +       #endif\n> >\n> > -       meth = SSLv23_method();\n> >         if (!meth) {\n> > -               ssl_socket_perror(\"SSLv23_method\");\n> > +       #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)\n> > +                       ssl_socket_perror(\"TLS_method\");\n> > +       #else\n> > +                       ssl_socket_perror(\"SSLv23_method\");\n> > +       #endif\n> >                 return -1;\n> >         }\n> >\n> >\n> > ---\n>\n> That diff looks pretty okay to me.\n>\n> > Also, on a different note: I'm actually really interested in applying\n> > to Git for GSoC, and I should be doing Git microprojects right now to\n> > properly cement my chance of doing GSoC with Git. Many aspiring GSoC\n> > applicants already been asking, enquiring and maybe even working about\n> > Git microprojects, as evident from the mailing list.\n>\n> For the record, I am not even sure whether Git will participate in GSoC\n> this year; I am not aware of any activity in that direction.\n>\n> Having said that, the purpose of a Git microproject is to get acquainted\n> with the development process of Git (at least in my mind). It is not so\n> much fixing some issue in Git, but more like learning how to interact with\n> the Git mailing list, in particular how to communicate effectively with\n> the developers/reviewers on this list.\n>\n> In that light, if I were a possible mentor (which I am not, at least not\n> in this year's GSoC) I would not insist on a microproject. Or more like: I\n> would accept your work on getting this vexing OpenSSL v1.1.1 issue sorted\n> out as a microproject in its own right.\n>\n> > So while I'm not saying that I'm in deep trouble and all this OpenSSL\n> > v1.1.1 issue fixing is completely useless (I'm learning quite a lot\n> > along the way and able to understand the project structure), but\n> > saying that I'm not worried about my GSoC prospects of working in this\n> > organization would honestly be false :) . I love git, I would love\n> > contributing to Git, but I'd love to do a GSoC Summer with Git much\n> > more than the rest.\n> >\n> > Please let me know where am I going wrong. If there's any other system\n> > packages that I can download so that I can focus on other Git issues\n> > and this one simultaneously, please let me know. Here are my system\n> > specifications (let me know if you need anything more specific):\n> > ---\n> > OS: Ubuntu 18.04\n> > Linux Kernel: 5.3\n> > OpenSSL Version: 1.1.1d\n> > ---\n> >\n> > Apologies for the long email,\n>\n> This is not even close to being the longest email sent to this list, so\n> don't worry!\n>\n> Ciao,\n> Johannes\n>\n> > Thank You,\n> > Nirmal Khedkar\n> > (https://nirmalhk7.github.io)\n> >\n> >\n> > On Thu, Jan 23, 2020 at 12:50 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > >\n> > > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > >\n> > > >> From my limited knowledge of OpenSSL libraries, I think the error has\n> > > >> more to do with 'SSL_library_init()' , which appears like a\n> > > >> constructor to the OpenSSL library. I found these emails regarding\n> > > >> \"if\" cases around this function. Please check out these patches:\n> > > >> 1. Rosen Penev:\n> > > >> https://lore.kernel.org/git/20181227023548.396-1-rosenp@gmail.com/\n> > > >\n> > > > I remember that one. And I agreed with Junio that the documentation\n> > > > suggests that the call is _optional_, while the patch suggests that it\n> > > > would be _incorrect_ instead.\n> > > >\n> > > > And looking at\n> > > > https://www.openssl.org/docs/man1.1.1/man3/SSL_library_init.html suggests\n> > > > to me that it is still supported.\n> > > >\n> > > > Having said that, if I look at the headers installed for `libssl-dev`\n> > > > version `1.1.1-1ubuntu2.1~18.04.5` in my Ubuntu installation, I see that\n> > > > `/usr/include/openssl/ssl.h` defines that symbol as:\n> > > >\n> > > >       #  define SSL_library_init() OPENSSL_init_ssl(0, NULL)\n> > > >\n> > > > but _only_:\n> > > >\n> > > >       # if OPENSSL_API_COMPAT < 0x10100000L\n> > > >\n> > > > So maybe that disagrees with the documentation that says that\n> > > > SSL_library_init() is optional?\n> > > >\n> > > > The curious thing is that `OPENSSL_API_COMPAT` is not even defined\n> > > > anywhere. So maybe it _is_ the right thing to also `#define\n> > > > SSL_library_init() (void)` in the diff you listed above?\n> > > >\n> > > > _Maybe_ guarded within `#ifndef SSL_library_init ... #endif` guards?\n> > > >\n> > > >> 2. eroen: https://lore.kernel.org/git/20170112104219.563497-1-git-scm@occam.eroen.eu/\n> > > >\n> > > > That sounds like a good suggestion, too.\n> > > >\n> > > >> Are the fixes made in these patches relevant here. Please let me know\n> > > >> if I'm going wrong.\n> > > >\n> > > > Yes, both threads are relevant, and if you can reconcile them into a patch\n> > > > that makes Git compile with OpenSSL v1.1.1, I will try my best to review\n> > > > them (Cc: me, just in case).\n> > >\n> > > I agree with the above reasoning and the suggestion given by Bates in\n> > > https://lore.kernel.org/git/66967e0e-8bd9-f4b6-d2d4-ccce9004f42e@nottheoilrig.com/\n> > > sounds like a reasonable one.\n> > >\n> > > Thanks for digging and double-checking these two previous efforts,\n> > > and giving another round of thoughts on them.\n> > >\n> > >\n> > >\n> > >\n> >\n"}]}