From 4fdf9cb808db9251feb1c23652da6141ce111437 Mon Sep 17 00:00:00 2001 From: Leorize Date: Thu, 4 Jun 2020 18:30:20 -0500 Subject: wrappers/openssl: defer loading SSL_CTX_set_ciphersuites --- lib/wrappers/openssl.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/wrappers') diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim index c81176a9b..b7f18ad79 100644 --- a/lib/wrappers/openssl.nim +++ b/lib/wrappers/openssl.nim @@ -425,7 +425,9 @@ else: raiseInvalidLibrary MainProc proc SSL_CTX_set_ciphersuites*(ctx: SslCtx, str: cstring): cint = - let theProc {.global.} = cast[proc(ctx: SslCtx, str: cstring) {.cdecl, gcsafe.}](sslSymThrows("SSL_CTX_set_ciphersuites")) + var theProc {.global.}: proc(ctx: SslCtx, str: cstring) {.cdecl, gcsafe.} + if theProc.isNil: + theProc = cast[typeof(theProc)](sslSymThrows("SSL_CTX_set_ciphersuites")) theProc(ctx, str) proc ERR_load_BIO_strings*(){.cdecl, dynlib: DLLUtilName, importc.} -- cgit 1.4.1-2-gfad0