Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
OpenSslCon Struct Reference

Detailed Description

OpenSSL-backed HTTP listener.

Configure SSL_CTX before construction. Check OpenSslCon_isValid after construction; socket setup has no direct constructor status. Listener configuration requires the dispatcher mutex.

#include <OpenSslCon.h>

Public Member Functions

 OpenSslCon (SSL_CTX *ctx, struct HttpServer *server, U16 port, BaBool setIP6, const void *interfaceName)
 Create an OpenSSL Server Connection Object. More...
 
int setPort (U16 portNumber, bool setIp6=false, const void *interfaceName=0)
 Open a replacement listener, then close the old listener on success. More...
 
 ~OpenSslCon ()
 Close and unregister the listener. More...
 

Constructor & Destructor Documentation

◆ OpenSslCon()

OpenSslCon::OpenSslCon ( SSL_CTX *  ctx,
struct HttpServer server,
U16  port,
BaBool  setIP6,
const void *  interfaceName 
)

Create an OpenSSL Server Connection Object.

Parameters
ctxRequired borrowed SSL_CTX configured for server use. Keep it alive throughout listener use; configure certificates before listening.
serverRequired borrowed server, valid throughout listener use.
portTCP listen port in host byte order, normally 443. Zero initializes an inactive listener without opening a socket.
setIP6TRUE selects IPv6, FALSE IPv4. This parameter is ignored unless the underlying TCP/IP stack is a dual IP V4 and IP V6 stack.
interfaceNameBorrowed platform binding address/interface, used during the call; normally a NUL-terminated address string. NULL binds the wildcard address. Accepted representation is platform-specific.

◆ ~OpenSslCon()

OpenSslCon::~OpenSslCon ( )

Close and unregister the listener.

Accepted connections are separate. Does not destroy the borrowed TLS configuration, server or dispatcher.

Member Function Documentation

◆ setPort()

int OpenSslCon::setPort ( U16  portNumber,
bool  setIp6 = false,
const void *  interfaceName = 0 
)

Open a replacement listener, then close the old listener on success.

Parameters
[in]portNumberNew TCP port in host byte order, 1..65535.
[in]setIp6True selects IPv6, false IPv4 (default).
[in]interfaceNameBorrowed platform binding address/interface, or NULL for wildcard; used during this call only.
Returns
Zero on success, -1 on failure. The old listener is retained if replacement setup fails. Uses the associated server's dispatcher. Hold the dispatcher mutex during this operation.