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

Unresolved external symbol UI_OpenSSL with latest OpenSSL 3.0.0 #4073

Closed
Liastre opened this issue Jun 25, 2019 · 8 comments
Labels

Comments

@Liastre
Copy link

@Liastre Liastre commented Jun 25, 2019

I did this

I've built latest Curl master with latest OpenSSL master

I expected the following

Successful build

curl/libcurl version

7.65.2-DEV

operating system

Building under UWP using VS2017

details

I've got following errors:

Curl.lib(openssl.obj) : error LNK2019: unresolved external symbol _UI_OpenSSL referenced in function _ssl_ui_reader

According to this document https://www.openssl.org/news/changelog.txt UI_OpenSSL() were deprecated and disabled, not sure if suggested UI_null() is safe to use with UI_method_get_reader

Usage of UI_OpenSSL() detected here

return (UI_method_get_reader(UI_OpenSSL()))(ui, uis);
and there
return (UI_method_get_writer(UI_OpenSSL()))(ui, uis);

@bagder

This comment has been minimized.

Copy link
Member

@bagder bagder commented Jun 25, 2019

I'm puzzled.

This is what their changelog says about UI_OpenSSL(), exactly:

The UI API becomes a permanent and integral part of libcrypto, i.e. not possible to disable entirely. However, it's still possible to disable the console reading UI method, UI_OpenSSL() (use UI_null() as a fallback).

still possible to disable doesn't mean it is disabled. I just built openssl from git master (again) and then subsequently curl against that lib and it worked just fine with no such linker error:

$ ./src/curl -V
curl 7.65.2-DEV (x86_64-pc-linux-gnu) libcurl/7.65.2-DEV OpenSSL/3.0.0 zlib/1.2.11 brotli/1.0.7 c-ares/1.14.0 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.40.0-DEV librtmp/2.3

How are you building your openssl when you get that disabled?

@Liastre

This comment has been minimized.

Copy link
Author

@Liastre Liastre commented Jun 25, 2019

I'm using build steps according the description for windows uwp:

perl Configure VC-WIN32-UWP --prefix="path" --openssldir="path" 
nmake

It might be I missed some flags

@bagder

This comment has been minimized.

Copy link
Member

@bagder bagder commented Jun 25, 2019

I have no idea what VC-WIN32-UWP does for the OpenSSL build but presumably this then disables that function. We need to understand what define you get set for this so that we can have the curl build use the same one and avoid trying to use UI_OpenSSL() when used.

Do you perhaps get OPENSSL_NO_UI_CONSOLE or OPENSSL_NO_UI defined or something?

@gvanem

This comment has been minimized.

Copy link
Contributor

@gvanem gvanem commented Jun 25, 2019

I have no idea what VC-WIN32-UWP does for the OpenSSL build
but presumably this then disables that function.

Seems it's disabled for UWP. From OpenSSL's Configurations/50-win-onecore.conf:

    "VC-WIN32-UWP" => {
        inherit_from    => [ "VC-WIN32-ONECORE" ],
        lflags          => add("/APPCONTAINER"),
        defines         => add("WINAPI_FAMILY=WINAPI_FAMILY_APP",
                               "_WIN32_WINNT=0x0A00"),
        dso_scheme      => "",
        disable         => [ 'ui-console', 'stdio', 'async', 'uplink' ],
@Liastre

This comment has been minimized.

Copy link
Author

@Liastre Liastre commented Jun 25, 2019

Hey @gvanem ah I see now, thanks. I found original pull-request discussion, there no any clue why it's been disabled. I'll try to rebuild openssl with enabled ui-console.

@bagder

This comment has been minimized.

Copy link
Member

@bagder bagder commented Jun 25, 2019

@Liastre maybe something like this?

diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index fa6d0201a..3cdcbfeb9 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -73,11 +73,11 @@
 #if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_OCSP)
 #include <openssl/ocsp.h>
 #endif
 
 #if (OPENSSL_VERSION_NUMBER >= 0x0090700fL) && /* 0.9.7 or later */     \
-  !defined(OPENSSL_NO_ENGINE)
+  !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_UI_CONSOLE)
 #define USE_OPENSSL_ENGINE
 #include <openssl/engine.h>
 #endif
 
 #include "warnless.h"
@gvanem

This comment has been minimized.

Copy link
Contributor

@gvanem gvanem commented Jun 25, 2019

... there no any clue why it's been disabled.

@Liastre, presumably since there are no <wincon.h> functions in UWP? So UI_OpenSSL() method won't work.

@Liastre

This comment has been minimized.

Copy link
Author

@Liastre Liastre commented Jun 25, 2019

Yay @bagder, that works! Everything is ok now. By the way I've tried and was unable to build with enabled ui-console, some unsupported win32 code involved.

@gvanem you are right!

bagder added a commit that referenced this issue Jun 25, 2019
... since that needs UI_OpenSSL() which isn't provided when OpenSSL is
built with OPENSSL_NO_UI_CONSOLE which happens when OpenSSL is built for
UWP (with "VC-WIN32-UWP").

Reported-by: Vasily Lobaskin
Fixes #4073
@bagder bagder closed this in c40eb32 Jun 26, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.