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

Linking error with OpenSSL 1.1 #1748

Closed
o3o opened this Issue Apr 26, 2017 · 13 comments

Comments

Projects
None yet
8 participants
@o3o

o3o commented Apr 26, 2017

I've last vibe.d:

$ cd vibe.d/
$ git describe
v0.8.0-beta.5-39-gd39a3601

After updating my ArchLinux:

$ cd ./examples/app_skeleton
$ dub 

Linking...
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:419: error: undefined reference to 'SSLv23_client_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:420: error: undefined reference to 'SSLv23_client_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:424: error: undefined reference to 'SSLv23_client_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:425: error: undefined reference to 'SSLv23_client_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:432: error: undefined reference to 'SSLv23_server_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:433: error: undefined reference to 'SSLv23_server_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:435: error: undefined reference to 'SSLv23_server_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:436: error: undefined reference to 'SSLv23_server_method'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:674: error: undefined reference to 'get_rfc3526_prime_2048'
../../../.dub/packages/openssl-1.1.5_1.0.1g/openssl/deimos/openssl/safestack.d:140: error: undefined reference to 'sk_num'
../../../.dub/packages/openssl-1.1.5_1.0.1g/openssl/deimos/openssl/safestack.d:142: error: undefined reference to 'sk_value'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:863: error: undefined reference to 'SSL_load_error_strings'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:864: error: undefined reference to 'SSL_library_init'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:866: error: undefined reference to 'CRYPTO_num_locks'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:874: error: undefined reference to 'CRYPTO_set_id_callback'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:875: error: undefined reference to 'CRYPTO_set_locking_callback'
../../../.dub/packages/vibe-d-0.8.0-beta.5/vibe-d/stream/vibe/stream/openssl.d:880: error: undefined reference to 'SSL_get_ex_new_index'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.

My environment

$ dub --version
DUB version 1.2.2, built on Apr 15 2017
$ dmd --version
DMD64 D Compiler v2.074.0
$ uname --all
Linux abe 4.10.11-1-ARCH #1 SMP PREEMPT Tue Apr 18 08:39:42 CEST 2017 x86_64 GNU/Linux

and my openssl:

# cd /usr/lib
# ls -l libssl*
-rwxr-xr-x 1 root root 361408 Apr 21 12:21 libssl3.so
lrwxrwxrwx 1 root root     13 Apr 26 14:28 libssl.so -> libssl.so.1.1
-r-xr-xr-x 1 root root 506600 Apr  5 09:12 libssl.so.1.0.0
-rwxr-xr-x 1 root root 437992 Feb 16 15:52 libssl.so.1.1

Changing link libssl.so -> libssl.so.1.1 to libssl.so -> libssl.so.1.0.0 has no effect

Thank you!

@o3o

This comment has been minimized.

Show comment
Hide comment
@o3o

o3o Apr 26, 2017

If I use:

// dub.sdl
configuration "application" {
   stringImportPaths "views" 
   targetType "executable"
   mainSourceFile "src/app.d"
   versions "VibeDefaultMain"
   versions "VibeNoSSL" //<---- !!
}

it works.

o3o commented Apr 26, 2017

If I use:

// dub.sdl
configuration "application" {
   stringImportPaths "views" 
   targetType "executable"
   mainSourceFile "src/app.d"
   versions "VibeDefaultMain"
   versions "VibeNoSSL" //<---- !!
}

it works.

@John-Colvin

This comment has been minimized.

Show comment
Hide comment
@John-Colvin

John-Colvin Apr 26, 2017

Contributor

Just hit this as well, looks like there were a few important changes for OpenSSL 1.1

Contributor

John-Colvin commented Apr 26, 2017

Just hit this as well, looks like there were a few important changes for OpenSSL 1.1

@linux-support

This comment has been minimized.

Show comment
Hide comment
@linux-support

linux-support Apr 26, 2017

Yesterday I did face the same issue on ArchLinux.
Is there a way to utilize OpenSSL 1.0 when linking applications with dub?

Yesterday I did face the same issue on ArchLinux.
Is there a way to utilize OpenSSL 1.0 when linking applications with dub?

@ThomasBrixLarsen

This comment has been minimized.

Show comment
Hide comment
@ThomasBrixLarsen

ThomasBrixLarsen Apr 27, 2017

You can do something like this:

--- .dub/packages/openssl-1.1.5_1.0.1g/openssl/dub.json.old     2017-04-27 10:23:01.602786627 +0200
+++ .dub/packages/openssl-1.1.5_1.0.1g/openssl/dub.json 2017-04-25 11:24:50.610391499 +0200
@@ -24,7 +24,7 @@
        "description": "Deimos bindings for the OpenSSL cryptographic library",
        "homepage": "http://www.openssl.org/",
        "libs-posix": [
-               "ssl.so",
-               "crypto.so"
+               ":libssl.so.1.0.0",
+               ":libcrypto.so.1.0.0"
        ]
 }

You can do something like this:

--- .dub/packages/openssl-1.1.5_1.0.1g/openssl/dub.json.old     2017-04-27 10:23:01.602786627 +0200
+++ .dub/packages/openssl-1.1.5_1.0.1g/openssl/dub.json 2017-04-25 11:24:50.610391499 +0200
@@ -24,7 +24,7 @@
        "description": "Deimos bindings for the OpenSSL cryptographic library",
        "homepage": "http://www.openssl.org/",
        "libs-posix": [
-               "ssl.so",
-               "crypto.so"
+               ":libssl.so.1.0.0",
+               ":libcrypto.so.1.0.0"
        ]
 }
@o3o

This comment has been minimized.

Show comment
Hide comment
@o3o

o3o Apr 27, 2017

@ThomasBrixLarsen: perfect, it works!
Thank you.

o3o commented Apr 27, 2017

@ThomasBrixLarsen: perfect, it works!
Thank you.

cym13 added a commit to cym13/dirduster that referenced this issue Jul 8, 2017

Update dub.json to fix linking
This is a workaround the fact that vibe-d and therefore requests doesn't
support OpenSSLv1.1 yet.

See vibe-d/vibe.d#1748
@MartinNowak

This comment has been minimized.

Show comment
Hide comment
@MartinNowak

MartinNowak Aug 3, 2017

Contributor

Please rename the issue to linking error with openssl 1.1.

Contributor

MartinNowak commented Aug 3, 2017

Please rename the issue to linking error with openssl 1.1.

@MartinNowak

This comment has been minimized.

Show comment
Hide comment
@MartinNowak

MartinNowak Aug 3, 2017

Contributor

Now the interesting question is whether we will address this in then openssl header, allowing people to update their openssl deimos to e.g. 2.0.0+1.1.0f.
The deimos project isn't too well maintained, e.g. the win lib is outdated.
Using dynamic bindings might be another option, e.g. ikod/dlang-requests@1ab90ff.

Contributor

MartinNowak commented Aug 3, 2017

Now the interesting question is whether we will address this in then openssl header, allowing people to update their openssl deimos to e.g. 2.0.0+1.1.0f.
The deimos project isn't too well maintained, e.g. the win lib is outdated.
Using dynamic bindings might be another option, e.g. ikod/dlang-requests@1ab90ff.

@s-ludwig s-ludwig changed the title from Linking error due to openssl to Linking error with OpenSSL 1.1 Aug 3, 2017

@s-ludwig s-ludwig closed this in 44ee1ad Aug 12, 2017

@o3o o3o changed the title from Linking error with OpenSSL 1.1 to Linking error with openssl 1.1 Aug 21, 2017

@o3o o3o changed the title from Linking error with openssl 1.1 to Linking error with OpenSSL 1.1 Aug 21, 2017

@quickfur

This comment has been minimized.

Show comment
Hide comment
@quickfur

quickfur Dec 4, 2017

Contributor

Just ran into this today. Is there any plan to support openssl ≥ 1.1.0 in the near future? How big of an API change are we talking about here?

Contributor

quickfur commented Dec 4, 2017

Just ran into this today. Is there any plan to support openssl ≥ 1.1.0 in the near future? How big of an API change are we talking about here?

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Dec 4, 2017

Member

Can you try if git master works when using the vibe-d:tls openssl-1.1 configuration*? There was a last minute fix that is not yet in the latest release. The plan is definitely to finally get this working right in the imminent 0.8.2 release.

* e.g. using {"dependencies": { ..., "vibe-d:tls": "*" }, "subConfigurations": {"vibe-d:tls": "openssl-1.1"}, ...}

Member

s-ludwig commented Dec 4, 2017

Can you try if git master works when using the vibe-d:tls openssl-1.1 configuration*? There was a last minute fix that is not yet in the latest release. The plan is definitely to finally get this working right in the imminent 0.8.2 release.

* e.g. using {"dependencies": { ..., "vibe-d:tls": "*" }, "subConfigurations": {"vibe-d:tls": "openssl-1.1"}, ...}

@andrewbenton

This comment has been minimized.

Show comment
Hide comment
@andrewbenton

andrewbenton Dec 4, 2017

Contributor

If the subconfiguration doesn't work for you, you can always add "VibeUseOpenSSL11" to the versions array in your dub.json.

Contributor

andrewbenton commented Dec 4, 2017

If the subconfiguration doesn't work for you, you can always add "VibeUseOpenSSL11" to the versions array in your dub.json.

@quickfur

This comment has been minimized.

Show comment
Hide comment
@quickfur

quickfur Dec 4, 2017

Contributor

Hmm. I'm getting this error from dub:

Non-optional dependency vibe-d:tls of mm not found in dependency tree!?.
Contributor

quickfur commented Dec 4, 2017

Hmm. I'm getting this error from dub:

Non-optional dependency vibe-d:tls of mm not found in dependency tree!?.
@quickfur

This comment has been minimized.

Show comment
Hide comment
@quickfur

quickfur Dec 4, 2017

Contributor

Oh nevermind, dub is fetching a release version, not git master. Ignore what I just said...

Contributor

quickfur commented Dec 4, 2017

Oh nevermind, dub is fetching a release version, not git master. Ignore what I just said...

@quickfur

This comment has been minimized.

Show comment
Hide comment
@quickfur

quickfur Dec 4, 2017

Contributor

Update: after overriding the dub repo with vibe-d git master, and adding the lines @s-ludwig posted above, I can now successfully link against openssl-1.1. Thanks for the help!

Contributor

quickfur commented Dec 4, 2017

Update: after overriding the dub repo with vibe-d git master, and adding the lines @s-ludwig posted above, I can now successfully link against openssl-1.1. Thanks for the help!

s-ludwig added a commit that referenced this issue Mar 18, 2018

s-ludwig added a commit that referenced this issue Apr 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment