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

Detect OpenSSL 1.1 automatically #2053

Closed
wilzbach opened this issue Jan 30, 2018 · 4 comments
Closed

Detect OpenSSL 1.1 automatically #2053

wilzbach opened this issue Jan 30, 2018 · 4 comments

Comments

@wilzbach
Copy link
Member

@wilzbach wilzbach commented Jan 30, 2018

Using

--override-config="vibe-d:tls/openssl-1.1"

all the time becomes a bit annoying and it's also very hard for newcomers to know that this option is needed when they look at the linker failures.

Ideas:

  1. Dynamically load OpenSSL (dlang-requests does this: ikod/dlang-requests#45)
  2. Add a pregenerate script that detects the currently installed version, e.g. (openssl version | cut -d " " -f2)
  3. Add such detection support in DUB, e.g. DUB will detect the versions of the libraries included for linking and then set special versions

(1) will be a lot of work, (2) would be hard to get working in a cross-platform way and (3) will be quite spammy.

Anyhow I guess (2) is probably the least amount of work. Ideas?

@EmTee70
Copy link

@EmTee70 EmTee70 commented Feb 8, 2018

I found the following - for me - strange behavior:
When using version "VibeNoSSL" and compiling with dub using dmd it compiles
and links.

When changing to the compiler to latest 1.7.0 ldc2 by --compiler ldc2

I get the openssl - probably known - linking errors:
penssl.d:722: error: undefined reference to 'get_rfc3526_prime_2048'
openssl.d:911: error: undefined reference to 'SSL_load_error_strings'
openssl.d:912: error: undefined reference to 'SSL_library_init'
openssl.d:914: error: undefined reference to 'CRYPTO_num_locks'
openssl.d:922: error: undefined reference to 'CRYPTO_set_id_callback'
openssl.d:923: error: undefined reference to 'CRYPTO_set_locking_callback'
openssl.d:928: error: undefined reference to 'SSL_get_ex_new_index'
/home/mt/d/db-browse/../../.dub/packages/openssl-1.1.6_1.0.1g/openssl/deimos/openssl/safestack.d:140: error: undefined reference to 'sk_num'
/home/mt/d/db-browse/../../.dub/packages/openssl-1.1.6_1.0.1g/openssl/deimos/openssl/safestack.d:142: error: undefined reference to 'sk_value'
collect2: error: ld returned 1 exit status

which I could avoid using an additional --override-config="vibe-d:tls/openssl-1.1"

Do you know why?

@wilzbach
Copy link
Member Author

@wilzbach wilzbach commented Mar 30, 2018

Maybe with Vibe.d 0.8.4 OpenSSL 1.1 could be the new default?

@claudiocabral
Copy link

@claudiocabral claudiocabral commented Jun 28, 2018

@EmTee70 I got it to compile in ldc with version VibeNoSSL adding

subConfiguration: {
    "vibe-d:tls": "notls"
}

I also noticed that if you don't pass this subconfiguration, dmd compiles because it links against openssl1.1.

I would expect VersionNoSSL to not use ssl at all, which is what I need for my project.

This build system needs to change a bit, I compile in macOS and Arch Linux and it's been quite annoying to find a configuration that works in both (macOS needs to link against openssl2.0 if memory doens't fail me)

@wilzbach
Copy link
Member Author

@wilzbach wilzbach commented Jul 18, 2018

A hack to detect OpenSSL 1.1 automatically: #2190

wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jul 18, 2018
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jul 18, 2018
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jul 18, 2018
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jul 19, 2018
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jul 19, 2018
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jul 19, 2018
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jul 19, 2018
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jan 31, 2019
wilzbach added a commit to wilzbach/vibe.d that referenced this issue Jan 31, 2019
@dlang-bot dlang-bot closed this in 53e6fb5 Feb 9, 2019
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
3 participants