Detect openssl related to outdated openssl and help user solve issue.

This commit is contained in:
Dominik Picheta 2018-02-25 13:34:32 +00:00
commit 1975998c56

View file

@ -430,8 +430,14 @@ when defineSsl:
raise newException(SSLError, "No error reported.")
if err == -1:
raiseOSError(osLastError())
var errStr = ErrErrorString(err, nil)
raise newException(SSLError, $errStr)
var errStr = $ErrErrorString(err, nil)
case err
of 336032814, 336032784:
errStr = "Please upgrade your OpenSSL library, it does not support the " &
"necessary protocols. OpenSSL error is: " & errStr
else:
discard
raise newException(SSLError, errStr)
proc getExtraData*(ctx: SSLContext, index: int): RootRef =
## Retrieves arbitrary data stored inside SSLContext.