--- title: GsmSecureClient --- # GsmSecureClient (class) **Module:** **[GsmSecureClient](class_gsm_secure_client.html)** The secure client class > [!NOTE] > This is a base class for secure clients, but it is NOT an inner class of the [TinyGsmSSL](class_tiny_gsm_s_s_l.md) class. `#include ` Inherited by TinyGsmA7672X::GsmClientSecureA7672X, TinyGsmBG96::GsmClientSecureBG96, TinyGsmESP32::GsmClientSecureESP32, TinyGsmESP8266::GsmClientSecureESP8266, TinyGsmSim7000SSL::GsmClientSecureSim7000SSL, TinyGsmSim7080::GsmClientSecureSim7080, TinyGsmSim7600::GsmClientSecureSim7600, TinyGsmXBee::GsmClientSecureXBee ## Client SSL configuration functions ### Public Functions | | Name | | -------------- | -------------- | | *virtual*
void | **[setSSLContextIndex](#a2bc46f89e3e2e15ddaf137a760e51e61)**(uint8_t sslCtxIndex)
Set the SSL context index or identifier to use for this connection. | | *virtual*
void | **[setSSLAuthMode](#a4b46715fbe03e7814302861c720ab022)**([SSLAuthMode](../files/_tiny_gsm_s_s_l_8tpp.md#ae4aaaef78c1c56ea03b96c5d9fbc7de6) mode)
Set the SSL authorization mode to use for this connection. | | *virtual*
void | **[setSSLVersion](#a90fa586822a2848ef1c0799b5f86a72d)**([SSLVersion](../files/_tiny_gsm_s_s_l_8tpp.md#a4cec5319261492fb0afbc8c3aded7055) version)
Set the SSL version to use for this connection. | ## Client certificate assignment functions ### Public Functions | | Name | | -------------- | -------------- | | *virtual*
void | **[setCACertName](#a6e4efbb501cc444aa5533ac83e818660)**(const char * CAcertName)
Set the CA certificate name to use for this connection. | | *virtual*
void | **[setCACertName](#a9c531872f5eea9ebb7d7242480af40e8)**(const String & CAcertName)
Set the CA certificate name to use for this connection. | | *virtual*
void | **[setClientCertName](#ad748837d7cbd8094d19bf0db83d8c250)**(const char * clientCertName)
Set the client certificate name to use for this connection. | | *virtual*
void | **[setClientCertName](#a409325e292e26ca63477c9fb5a7012ce)**(const String & clientCertName)
Set the client certificate name to use for this connection. | | *virtual*
void | **[setPrivateKeyName](#a9c94b672781edf4f0ffbb474825ffa99)**(const char * clientKeyName)
Set the client private key name to use for this connection. | | *virtual*
void | **[setPrivateKeyName](#ad9aa73781d1ce7022242b4eda36a0c27)**(const String & clientKeyName)
Set the client private key name to use for this connection. | ## Client PSK assignment functions ### Public Functions | | Name | | -------------- | -------------- | | *virtual*
void | **[setPSKTableName](#a64c8288ba08845f36933f2b551346d59)**(const char * pskTableName)
Set the PSK table name to use for this connection. | | *virtual*
void | **[setPSKTableName](#ada834301f0221d06538c70cbd84f378b)**(const String & pskTableName)
Set the PSK table name to use for this connection. | | *virtual*
void | **[setPreSharedKey](#aed7d395100a2c79405bb1aa75fea7b14)**(const char * pskIdent, const char * psKey)
Set the pre-shared key and identity to use for this connection. | | *virtual*
void | **[setPreSharedKey](#abba6fff24f0aa3d7e350a5d412c4906e)**(const String & pskIdent, const String & psKey)
Set the pre-shared key and identity to use for this connection. | ## Public Functions Documentation ### Client SSL configuration functions #### functionsetSSLContextIndex ```cpp virtual void setSSLContextIndex(uint8_t sslCtxIndex) ``` > [!IMPORTANT] > The SSL context index set here must be **exactly what the modem will use as the context identifier within AT commands**. Use whatever indexing the modem uses. This library will **not** adjust or validate the index for you. If unspecified, this library will use [TINY_GSM_DEFAULT_SSL_CTX](../files/_tiny_gsm_s_s_l_8tpp.md#a10d35708942586581bbce94e1838039f). > [!NOTE] > This is not the same as the position of the client in the modem's socket array (the mux) or the connection identifier. The context index is a separate identifier used by the modem to manage groups of SSL settings. - **Parameters**: - **sslCtxIndex** The SSL context index #### functionsetSSLAuthMode ```cpp virtual void setSSLAuthMode([SSLAuthMode](../files/_tiny_gsm_s_s_l_8tpp.md#ae4aaaef78c1c56ea03b96c5d9fbc7de6) mode) ``` - **Parameters**: - **mode** The SSL authorization mode #### functionsetSSLVersion ```cpp virtual void setSSLVersion([SSLVersion](../files/_tiny_gsm_s_s_l_8tpp.md#a4cec5319261492fb0afbc8c3aded7055) version) ``` - **Parameters**: - **version** The SSL version ### Client certificate assignment functions #### functionsetCACertName ```cpp virtual void setCACertName(const char * CAcertName) ``` - **Parameters**: - **CAcertName** The CA certificate name #### functionsetCACertName ```cpp virtual void setCACertName(const String & CAcertName) ``` - **Parameters**: - **CAcertName** The CA certificate name #### functionsetClientCertName ```cpp virtual void setClientCertName(const char * clientCertName) ``` - **Parameters**: - **clientCertName** The client certificate name #### functionsetClientCertName ```cpp virtual void setClientCertName(const String & clientCertName) ``` - **Parameters**: - **clientCertName** The client certificate name #### functionsetPrivateKeyName ```cpp virtual void setPrivateKeyName(const char * clientKeyName) ``` - **Parameters**: - **clientKeyName** The client private key name #### functionsetPrivateKeyName ```cpp virtual void setPrivateKeyName(const String & clientKeyName) ``` - **Parameters**: - **clientKeyName** The client private key name ### Client PSK assignment functions #### functionsetPSKTableName ```cpp virtual void setPSKTableName(const char * pskTableName) ``` - **Parameters**: - **pskTableName** The PSK table name #### functionsetPSKTableName ```cpp virtual void setPSKTableName(const String & pskTableName) ``` - **Parameters**: - **pskTableName** The PSK table name #### functionsetPreSharedKey ```cpp virtual void setPreSharedKey(const char * pskIdent, const char * psKey) ``` - **Parameters**: - **pskIdent** The pre-shared key identity (also called the identity hint or just hint) - **psKey** The pre-shared key #### functionsetPreSharedKey ```cpp virtual void setPreSharedKey(const String & pskIdent, const String & psKey) ``` - **Parameters**: - **pskIdent** The pre-shared key identity (also called the identity hint or just hint) - **psKey** The pre-shared key ------------------------------- Generated by [Doxygen](https://www.doxygen.nl) and [m.css](https://mcss.mosra.cz/) with templates from [doxybook2](https://github.com/matusnovak/doxybook2) Updated on 2026-09-11