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

Linking error with OpenSSL 1.1 #1748

Closed
o3o opened this issue Apr 26, 2017 · 14 comments
Closed

Linking error with OpenSSL 1.1 #1748

o3o opened this issue Apr 26, 2017 · 14 comments

Comments

@o3o
Copy link

@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
Copy link
Author

@o3o 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
Copy link
Contributor

@John-Colvin 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
Copy link

@linux-support linux-support commented 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?

@ThomasBrixLarsen
Copy link

@ThomasBrixLarsen ThomasBrixLarsen commented 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"
        ]
 }
@o3o
Copy link
Author

@o3o o3o commented Apr 27, 2017

@ThomasBrixLarsen: perfect, it works!
Thank you.

cym13 pushed a commit to cym13/dirduster that referenced this issue Jul 8, 2017
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
Copy link
Contributor

@MartinNowak MartinNowak commented Aug 3, 2017

Please rename the issue to linking error with openssl 1.1.

@MartinNowak
Copy link
Contributor

@MartinNowak 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 Linking error due to openssl 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 Linking error with OpenSSL 1.1 Linking error with openssl 1.1 Aug 21, 2017
@o3o o3o changed the title Linking error with openssl 1.1 Linking error with OpenSSL 1.1 Aug 21, 2017
@quickfur
Copy link
Contributor

@quickfur 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
Copy link
Member

@s-ludwig 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
Copy link
Contributor

@andrewbenton 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
Copy link
Contributor

@quickfur 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
Copy link
Contributor

@quickfur quickfur commented Dec 4, 2017

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

@quickfur
Copy link
Contributor

@quickfur 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
@emil-perhinschi
Copy link

@emil-perhinschi emil-perhinschi commented Mar 9, 2019

Oh nevermind, dub is fetching a release version, not git master. Ignore what I just said...
thank you, this put me on the right track

to make it clearer for those who still have to cogitate when using dub: this are the minimal changes I had to make

"dependencies": { "vibe-d": "*", "vibe-d:tls" :"*" }, "subConfigurations": {"vibe-d:tls": "openssl-1.1"},
then ran this in the root of the project

rm dub.selections.json

and

dub --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants
You can’t perform that action at this time.