tfSslNewSession

Jump to: navigation, search

Table of Contents >> SSL Programmer's Reference


#include <trsocket.h>


int tfSslNewSession (
char TM_FAR * certIdentity,
unsigned int maxCaches,
int version,
unsigned int option
);


Function Description

tfSslNewSession() opens a new SSL session (could be used as either SSL server session or SSL client session). If it is going to be used as SSL server session, please make sure the certIdentity is non-null, otherwise SSL server can’t run on this session.


Parameters

  • certIdentity
    The SSL server/client’s own certificate name. For Treck crypto library, whenever you add one certificate, you assign a name to that certificate. certIdentity is the name of that certificate.
  • maxCaches
    The maximum number of caches user wants to store for this session. Must be greater or equal to zero. If zero is passed in, there is no cache at all. That means there is no connection resumption at all either. Note that each cache entry will consume about 100 bytes memory.
  • version
    The set of SSL/TLS versions this session will support. Specify a bitwise OR combination of TM_SSL_VERSION_30, TM_TLS_VERSION_10, TM_TLS_VERSION_11 and TM_TLS_VERSION_12.
  • option
    The only options we support currently are TM_SSL_OPT_CLIENTAUTH which requires client authentication, and TM_SSL_OPT_SERVERPROP, which allows server to select proposals. Enter zero to disable any option. These two options are only useful for an SSL server session. See tfSslSetSessionOptions() for detail information


Returns

  • (-1 * )TM_EPERM
    tvSslTlsPtr is NULL. The user must call tfUseSsl() first
  • (-1 * )TM_EINVAL
    Input parameter is invalid
  • (-1 * )TM_ENOBUFS
    No buffers available
  • Non-negative number
    Session ID for the session just created


Table of Contents >> SSL Programmer's Reference