diff options
-rw-r--r-- | changelog.md | 2 | ||||
-rw-r--r-- | lib/pure/asyncnet.nim | 5 | ||||
-rw-r--r-- | lib/pure/net.nim | 5 |
3 files changed, 12 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 0c95295cd..d1e04177d 100644 --- a/changelog.md +++ b/changelog.md @@ -69,6 +69,8 @@ - Fixed buffer overflow bugs in `net` +- Exported `sslHandle` from `net` and `asyncnet`. + - Added `sections` iterator in `parsecfg`. - Make custom op in macros.quote work for all statements. diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim index 7ef40a128..5523fa10e 100644 --- a/lib/pure/asyncnet.nim +++ b/lib/pure/asyncnet.nim @@ -736,6 +736,11 @@ proc close*(socket: AsyncSocket) = raiseSSLError() when defineSsl: + proc sslHandle*(self: AsyncSocket): SslPtr = + ## Retrieve the ssl pointer of `socket`. + ## Useful for interfacing with `openssl`. + self.sslHandle + proc wrapSocket*(ctx: SslContext, socket: AsyncSocket) = ## Wraps a socket in an SSL context. This function effectively turns ## `socket` into an SSL socket. diff --git a/lib/pure/net.nim b/lib/pure/net.nim index 343cdc9b1..ff179fb2c 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -501,6 +501,11 @@ when defineSsl: ERR_load_BIO_strings() OpenSSL_add_all_algorithms() + proc sslHandle*(self: Socket): SslPtr = + ## Retrieve the ssl pointer of `socket`. + ## Useful for interfacing with `openssl`. + self.sslHandle + proc raiseSSLError*(s = "") = ## Raises a new SSL error. if s != "": |