#include <HttpServCon.h>
#include <openssl/ssl.h>
Go to the source code of this file.
◆ OpenSslCon_isValid
- Parameters
-
| [in] | o | Initialized listener. |
- Returns
- TRUE if its listening socket is valid, FALSE otherwise.
◆ OpenSslCon
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.
◆ OpenSslCon_constructor()
| SHARKSSL_API void OpenSslCon_constructor |
( |
OpenSslCon * |
o, |
|
|
SSL_CTX * |
ctx, |
|
|
struct HttpServer * |
server, |
|
|
U16 |
port, |
|
|
BaBool |
setIP6, |
|
|
const void * |
interfaceName |
|
) |
| |
Create an OpenSSL Server Connection Object.
- Parameters
-
| ctx | Required borrowed SSL_CTX configured for server use. Keep it alive throughout listener use; configure certificates before listening. |
| server | Required borrowed server, valid throughout listener use. |
| port | TCP listen port in host byte order, normally 443. Zero initializes an inactive listener without opening a socket. |
| setIP6 | TRUE selects IPv6, FALSE IPv4. This parameter is ignored unless the underlying TCP/IP stack is a dual IP V4 and IP V6 stack. |
| interfaceName | Borrowed platform binding address/interface, used during the call; normally a NUL-terminated address string. NULL binds the wildcard address. Accepted representation is platform-specific. |
| [out] | o | Caller-owned listener storage. |
◆ OpenSslCon_destructor()
| SHARKSSL_API void OpenSslCon_destructor |
( |
OpenSslCon * |
o | ) |
|
Close and unregister the listener.
Accepted connections are separate.
- Parameters
-
| [in,out] | o | Initialized listener; no borrowed dependency is freed. |
◆ OpenSslCon_setPort()
| SHARKSSL_API int OpenSslCon_setPort |
( |
OpenSslCon * |
o, |
|
|
U16 |
portNumber, |
|
|
BaBool |
setIp6, |
|
|
const void * |
interfaceName |
|
) |
| |
Open a replacement listener, then close the old listener on success.
- Parameters
-
| [in] | portNumber | New TCP port in host byte order, 1..65535. |
| [in] | setIp6 | True selects IPv6, false IPv4 (default). |
| [in] | interfaceName | Borrowed 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.
- Parameters
-
| [in,out] | o | Initialized listener. |