W3cubDocs

/Nim

Module ssl

This module provides an easy to use sockets-style nim interface to the OpenSSL library.

Warning: This module is deprecated, use the SSL procedures defined in the net module instead.

Imports

openssl, strutils, os

Types

SecureSocket = object
  ssl: SslPtr
  bio: BIO

Procs

proc connect(sock: var SecureSocket; address: string; port: int): int {...}{.
    raises: [Exception, OSError], tags: [RootEffect].}
Connects to the specified address on the specified port. Returns the result of the certificate validation.
proc recvLine(sock: SecureSocket; line: var TaintedString): bool {...}{.raises: [], tags: [].}
Acts in a similar fashion to the recvLine in the sockets module. Returns false when no data is available to be read. Line must be initialized and not nil!
proc send(sock: SecureSocket; data: string) {...}{.raises: [OSError], tags: [].}
Writes data to the socket.
proc close(sock: SecureSocket) {...}{.raises: [OSError], tags: [].}
Closes the socket

© 2006–2018 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/ssl.html