TSSLSocket

SSL encrypted socket implementation using OpenSSL.

Note: On Posix systems which do not have the BSD-specific SO_NOSIGPIPE flag, you might want to ignore the SIGPIPE signal, as OpenSSL might try to write to a closed socket if the peer disconnects abruptly:

import core.stdc.signal;
import core.sys.posix.signal;
signal(SIGPIPE, SIG_IGN);

Constructors

this
this(TSSLContext context, Socket socket)

Creates an instance that wraps an already created, connected (!) socket.

this
this(TSSLContext context, string host, ushort port)

Creates a new unconnected socket that will connect to the given host on the given port.

Members

Functions

accessManager
void accessManager(TAccessManager value)

The access manager to use.

close
void close()
Undocumented in source. Be warned that the author may not have intended to support it.
flush
void flush()
Undocumented in source. Be warned that the author may not have intended to support it.
isOpen
bool isOpen()
Undocumented in source. Be warned that the author may not have intended to support it.
open
void open()
Undocumented in source. Be warned that the author may not have intended to support it.
peek
bool peek()
Undocumented in source. Be warned that the author may not have intended to support it.
read
size_t read(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
serverSide
bool serverSide()
void serverSide(bool value)

Whether to use client or server side SSL handshake protocol.

write
void write(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From TSocket

open
void open()

Connects the socket.

close
void close()

Closes the socket.

peek
bool peek()
Undocumented in source. Be warned that the author may not have intended to support it.
read
size_t read(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
writeSome
size_t writeSome(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
sendTimeout
void sendTimeout(Duration value)
Undocumented in source. Be warned that the author may not have intended to support it.
recvTimeout
void recvTimeout(Duration value)
Undocumented in source. Be warned that the author may not have intended to support it.
maxRecvRetries
ushort maxRecvRetries()
void maxRecvRetries(ushort value)
DEFAULT_MAX_RECV_RETRIES
enum DEFAULT_MAX_RECV_RETRIES;

Maximum number of retries for receiving from socket on read() in case of EAGAIN/EINTR.

setSocketOpts
void setSocketOpts()
Undocumented in source. Be warned that the author may not have intended to support it.
setTimeout
void setTimeout(SocketOption type, Duration value)
Undocumented in source. Be warned that the author may not have intended to support it.
maxRecvRetries_
ushort maxRecvRetries_;

Maximum number of recv() retries.

Meta