Skip to content

Commit 1975998

Browse files
committed
Detect openssl related to outdated openssl and help user solve issue.
1 parent e4515f3 commit 1975998

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/pure/net.nim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,14 @@ when defineSsl:
430430
raise newException(SSLError, "No error reported.")
431431
if err == -1:
432432
raiseOSError(osLastError())
433-
var errStr = ErrErrorString(err, nil)
434-
raise newException(SSLError, $errStr)
433+
var errStr = $ErrErrorString(err, nil)
434+
case err
435+
of 336032814, 336032784:
436+
errStr = "Please upgrade your OpenSSL library, it does not support the " &
437+
"necessary protocols. OpenSSL error is: " & errStr
438+
else:
439+
discard
440+
raise newException(SSLError, errStr)
435441

436442
proc getExtraData*(ctx: SSLContext, index: int): RootRef =
437443
## Retrieves arbitrary data stored inside SSLContext.

0 commit comments

Comments
 (0)