summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLeorize <leorize+oss@disroot.org>2020-06-04 18:30:20 -0500
committerAndreas Rumpf <rumpf_a@web.de>2020-06-06 21:11:53 +0200
commit4fdf9cb808db9251feb1c23652da6141ce111437 (patch)
tree5e22f0411971c3f082b61f64c22a93359c72cd07
parent6b2d8bfc8b9e46ae92e490111cb6a2abc49a32b6 (diff)
downloadNim-4fdf9cb808db9251feb1c23652da6141ce111437.tar.gz
wrappers/openssl: defer loading SSL_CTX_set_ciphersuites
-rw-r--r--lib/wrappers/openssl.nim4
1 files changed, 3 insertions, 1 deletions
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.}