From 1975998c566d2235cad216b2addb2246b8ee95f0 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sun, 25 Feb 2018 13:34:32 +0000 Subject: [PATCH] Detect openssl related to outdated openssl and help user solve issue. --- lib/pure/net.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/pure/net.nim b/lib/pure/net.nim index 99d868847..af9eea51a 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -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.