Merge branch 'starttls' of https://github.com/wiml/Nim into wiml-starttls
Conflicts: lib/pure/net.nim
This commit is contained in:
commit
8853dfb353
2 changed files with 89 additions and 53 deletions
|
|
@ -472,6 +472,15 @@ when defined(ssl):
|
|||
socket.bioOut = bioNew(bio_s_mem())
|
||||
sslSetBio(socket.sslHandle, socket.bioIn, socket.bioOut)
|
||||
|
||||
proc wrapSocket*(ctx: SslContext, socket: AsyncSocket, handshake: SslHandshakeType) =
|
||||
wrapSocket(ctx, socket)
|
||||
|
||||
case handshake
|
||||
of handshakeAsClient:
|
||||
sslSetConnectState(socket.sslHandle)
|
||||
of handshakeAsServer:
|
||||
sslSetAcceptState(socket.sslHandle)
|
||||
|
||||
proc getSockOpt*(socket: AsyncSocket, opt: SOBool, level = SOL_SOCKET): bool {.
|
||||
tags: [ReadIOEffect].} =
|
||||
## Retrieves option ``opt`` as a boolean value.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue