From 67b66bdd406566e7345609aa95bb68a13345e197 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Tue, 8 Sep 2020 12:17:18 -0400 Subject: [PATCH] fix lib name on ubuntu --- http2.d | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/http2.d b/http2.d index 8a0d611..784b44b 100644 --- a/http2.d +++ b/http2.d @@ -1793,15 +1793,19 @@ version(use_openssl) { import core.stdc.stdio; shared static this() { - version(Posix) - ossllib_handle = dlopen("libssl.so", RTLD_NOW); - else version(Windows) { + version(Posix) { + ossllib_handle = dlopen("libssl.so.1.1", RTLD_NOW); + if(ossllib_handle is null) + ossllib_handle = dlopen("libssl.so", RTLD_NOW); + } else version(Windows) { ossllib_handle = LoadLibraryW("libssl32.dll"w.ptr); oeaylib_handle = LoadLibraryW("libeay32.dll"w.ptr); } if(ossllib_handle is null) - throw new Exception("ssl fail open"); + throw new Exception("libssl library not found"); + if(oeaylib_handle is null) + throw new Exception("libeay32 library not found"); foreach(memberName; __traits(allMembers, ossllib)) { alias t = typeof(__traits(getMember, ossllib, memberName));