Skip to content

Instantly share code, notes, and snippets.

@stvnfx
Created May 19, 2019 18:50
Show Gist options
  • Save stvnfx/6606b51235e6b4b52c0b1bba503e5c89 to your computer and use it in GitHub Desktop.
Save stvnfx/6606b51235e6b4b52c0b1bba503e5c89 to your computer and use it in GitHub Desktop.
alternative nim ssl ctx example
proc getAlternativeSSL(): SSLContext =
result = dcSSLContext
when defined(ssl):
if result == nil:
dcSSLContext = newContext(verifyMode = CVerifyNone, certFile = "myapp.pem", keyFile = "myapp.pem", password = "123")
result = dcSSLContext
doAssert result != nil, "failure to initialize the SSL context"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment