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

undefined reference to methods in ssl #1651

Closed
aermicioi opened this issue Jan 2, 2017 · 17 comments
Closed

undefined reference to methods in ssl #1651

aermicioi opened this issue Jan 2, 2017 · 17 comments

Comments

@aermicioi
Copy link

@aermicioi aermicioi commented Jan 2, 2017

Good day.

I'm trying to generate docs for my project using dub build --build=ddox command.
Since it's not compiled (even downloaded), dub fetches ddox and compiles it.
Upon compiling, several undefined reference errors occur, while linking ddox.
Here is error output compilation:

Performing "debug" build using dmd for x86_64.
hyphenate 1.1.1: target for configuration "library" is up to date.
libdparse 0.7.0-beta.2: target for configuration "library" is up to date.
vibe-d:utils 0.7.30: target for configuration "library" is up to date.
vibe-d:data 0.7.30: target for configuration "library" is up to date.
vibe-d:core 0.7.30: target for configuration "libevent" is up to date.
vibe-d:http 0.7.30: target for configuration "library" is up to date.
vibe-d:diet 0.7.30: target for configuration "library" is up to date.
vibe-d:web 0.7.30: target for configuration "library" is up to date.
ddox 0.15.18: building configuration "application"...
Compiling diet template 'ddox.overview.dt'...
Compiling diet template 'ddox.module.dt'...
Compiling diet template 'ddox.docpage.dt'...
Linking...
../../../.dub/packages/vibe-d-0.7.30/vibe-d/.dub/build/libevent-debug-linux.posix-x86_64-dmd_2071-C73551D7DEB5DA5DE3D23DD888D67AF6/libvibe-d_core.a(openssl_23d0_569.o): In function `_D4vibe6stream7openssl14OpenSSLContext6__ctorMFE4vibe6stream3tls14TLSContextKindE4vibe6stream3tls10TLSVersionZC4vibe6stream7openssl14OpenSSLContext':
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:393: undefined reference to `SSLv23_client_method'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:394: undefined reference to `SSLv23_client_method'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:398: undefined reference to `SSLv23_client_method'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:399: undefined reference to `SSLv23_client_method'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:406: undefined reference to `SSLv23_server_method'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:407: undefined reference to `SSLv23_server_method'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:409: undefined reference to `SSLv23_server_method'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:410: undefined reference to `SSLv23_server_method'
../../../.dub/packages/vibe-d-0.7.30/vibe-d/.dub/build/libevent-debug-linux.posix-x86_64-dmd_2071-C73551D7DEB5DA5DE3D23DD888D67AF6/libvibe-d_core.a(openssl_23d0_569.o): In function `_D4vibe6stream7openssl14OpenSSLContext11setDHParamsMFAyaZv':
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:643: undefined reference to `get_rfc3526_prime_2048'
../../../.dub/packages/vibe-d-0.7.30/vibe-d/.dub/build/libevent-debug-linux.posix-x86_64-dmd_2071-C73551D7DEB5DA5DE3D23DD888D67AF6/libvibe-d_core.a(safestack_23e6_449.o): In function `_D6deimos7openssl9safestack57__T10SKM_sk_numTS6deimos7openssl6x509v315GENERAL_NAME_stZ16__T10SKM_sk_numZ10SKM_sk_numFNbPS6deimos7openssl9safestack54__T8STACK_OFTS6deimos7openssl6x509v315GENERAL_NAME_stZ8STACK_OFZi':
~/.dub/packages/openssl-1.1.5_1.0.1g/openssl/deimos/openssl/safestack.d:140: undefined reference to `sk_num'
../../../.dub/packages/vibe-d-0.7.30/vibe-d/.dub/build/libevent-debug-linux.posix-x86_64-dmd_2071-C73551D7DEB5DA5DE3D23DD888D67AF6/libvibe-d_core.a(safestack_23e8_516.o): In function `_D6deimos7openssl9safestack59__T12SKM_sk_valueTS6deimos7openssl6x509v315GENERAL_NAME_stZ18__T12SKM_sk_valueZ12SKM_sk_valueFNbPS6deimos7openssl9safestack54__T8STACK_OFTS6deimos7openssl6x509v315GENERAL_NAME_stZ8STACK_OFiZPS6deimos7openssl6x509v315GENERAL_NAME_st':
~/.dub/packages/openssl-1.1.5_1.0.1g/openssl/deimos/openssl/safestack.d:142: undefined reference to `sk_value'
../../../.dub/packages/vibe-d-0.7.30/vibe-d/.dub/build/libevent-debug-linux.posix-x86_64-dmd_2071-C73551D7DEB5DA5DE3D23DD888D67AF6/libvibe-d_core.a(openssl.o): In function `_D4vibe6stream7openssl20_sharedStaticCtor105FZv':
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:832: undefined reference to `SSL_load_error_strings'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:833: undefined reference to `SSL_library_init'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:835: undefined reference to `CRYPTO_num_locks'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:843: undefined reference to `CRYPTO_set_id_callback'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:844: undefined reference to `CRYPTO_set_locking_callback'
~/.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/stream/openssl.d:849: undefined reference to `SSL_get_ex_new_index'
collect2: error: ld returned 1 exit status
--- errorlevel 1
dmd failed with exit code 1.

Tried this on debian sid.
version of libssl:
libssl -> 1.1.0c-2

@tchaloupka
Copy link
Contributor

@tchaloupka tchaloupka commented Jan 2, 2017

I guess this can be caused by missing libssl-dev package?

@aermicioi
Copy link
Author

@aermicioi aermicioi commented Jan 2, 2017

It's not missing, it's listed as installed in system by aptitude.
ldconfig also lists .so files for libssl.
I've tried this as well with a previous version of vibed 0.7.29, same error. It seems that these functions are not present in the shared library.
Interesting is that, I've attempted to replace libssl, with gnutls implementation of ssl present on debian sid
(libgnutls-openssl-dev), and some undefined references dissappeared (SSLv23_client_method at least), though the undefined references with CRYPTO... remained.

@Skrupellos
Copy link

@Skrupellos Skrupellos commented Feb 12, 2017

These functions got deprecated with OpenSSL 1.1.0. The soon appearing Debian stretch uses OpenSSL 1.1.

Problems still exist when setting versions "VibeNoSSL".

@denizzzka
Copy link
Contributor

@denizzzka denizzzka commented Mar 30, 2017

Same problem. Are you tried to add also "crypto" library into libs section?

@denizzzka
Copy link
Contributor

@denizzzka denizzzka commented Apr 6, 2017

Also, try to install libssl1.0-dev - this solves same problem for me

@aermicioi
Copy link
Author

@aermicioi aermicioi commented Apr 6, 2017

installing libssl1.0-dev solved the problem.
Not sure though if the issue should be closed since debian stretch and upper will use openssl 1.1 therefore breaking vibe-d apps that use ssl.

@burner
Copy link
Contributor

@burner burner commented May 9, 2017

from the openssl docs
"""
Use of these functions is deprecated. They have been replaced with the above TLS_method(), TLS_server_method() and TLS_client_method() respectively. New code should use those functions instead.
"""

@chardetm
Copy link

@chardetm chardetm commented May 25, 2017

I'm having the same problem with version 0.7.31 on Arch, I tried installing the extra/openssl-1.0 package but it doesn't seem to solve anything.

Any ideas? Thanks!

@skoppe
Copy link
Contributor

@skoppe skoppe commented May 25, 2017

Same on Arch here. After installing extra/openssl-1.0 and renaming the links in /usr/lib it worked.

But surely there must be a better solution than this...

@wilzbach
Copy link
Member

@wilzbach wilzbach commented May 25, 2017

As pointed out here there are two simple "hacks" to solve the problem temporarily:

  • versions "Have_Botan" (SSL purely in D)
  • versions "VibeNoSSL" (and use Nginx etc. as reverse proxy, you should be doing this anyways)

See also the linked issue for a PR with a more permanent solution.

@skoppe
Copy link
Contributor

@skoppe skoppe commented May 26, 2017

That doesn't work as well as it should.

@andrewbenton
Copy link
Contributor

@andrewbenton andrewbenton commented Jul 14, 2017

This is now an issue in Fedora 26.

@skoppe
Copy link
Contributor

@skoppe skoppe commented Jul 15, 2017

As a workaround you can use Botan instead of OpenSSL (see https://forum.dlang.org/post/ok29hs$iio$1@digitalmars.com)

The proper fix would be to update the openssl deimos bindings.

@minexew
Copy link

@minexew minexew commented Feb 5, 2018

@andrewbenton Have you been able to work around it?

@skoppe
Copy link
Contributor

@skoppe skoppe commented Feb 13, 2018

For archlinux I made it work by adding the following to my dub.sdl file

dependency "vibe-d:core" version="~>0.8.2"
subConfiguration "vibe-d:tls" "openssl-1.1"

you can also use botan as a subconfiguration, plus others. Just check the dub.sdl in the vibe-d core subpackage in the vibe d repo on github.

@ssb22
Copy link

@ssb22 ssb22 commented Mar 12, 2018

On Fedora 27 with dmd installed from rpm, the hello.d supplied in the README.md does not compile out of the box, but does compile if you change the dub.sdl part to:

/+ dub.sdl:
name "hello_vibed"
dependency "vibe-d" version="~>0.8.2"
dependency "vibe-d:tls" version="~>0.8.2"
subConfiguration "vibe-d:tls" "openssl-1.1"
+/
s-ludwig added a commit that referenced this issue Mar 18, 2018
@betrixed
Copy link

@betrixed betrixed commented Apr 14, 2018

Link issues on ArchLinux-64, with fresh setup for dmd & dub.
First (readable) error is ../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:467: undefined reference to `SSLv23_client_method'
Fixed, compiled and ran after dub.sdl has 2 lines
added , noted from ssb22 above, thanks.
dependency "vibe-d:tls" version="~>0.8.2"
subConfiguration "vibe-d:tls" "openssl-1.1"

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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