Created
May 19, 2019 18:50
-
-
Save stvnfx/6606b51235e6b4b52c0b1bba503e5c89 to your computer and use it in GitHub Desktop.
alternative nim ssl ctx example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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