mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-04 21:14:48 +00:00
Export sslHandle in net and asyncnet. (#17573)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 != "":
|
||||
|
||||
Reference in New Issue
Block a user