This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3200SDK_1.1.0 mqtt client example with security question

Hi 

I am try to connect the mqtt client with security, i found the struct  SlMqttServer_t with following defined, what is that mean the field "method" and "cipher", i can not found their definition.  thank you 

        typedef struct {

#define SL_MQTT_NETCONN_IP6  0x04  /**< Assert for IPv6 connection, otherwise  IPv4 */

#define SL_MQTT_NETCONN_URL  0x08  /**< Server address is an URL and not IP address */

#define SL_MQTT_NETCONN_SEC  0x10  /**< Connection to server  must  be secure (TLS) */

                _u32         netconn_flags; /**< Enumerate connection type  */

                const char          *server_addr;   /**< Server Address: URL or IP  */

                _u16       port_number;   /**< Port number of MQTT server */

                char        method;        /**< Method to tcp secured socket */

                _u32         cipher;        /**< Cipher to tcp secured socket */

                _u32         n_files;       /**< Number of files for secure transfer */

                char * const        *secure_files;  /* SL needs 4 files*/

        } SlMqttServer_t;

  • Hi,

    We will check this and get back to you.

    Regards,
    Raghavendra
  • Hi,

    The 'method' is the secure socket methods defined in socket.h, set using sl_SetSockOpt option SL_SO_SECMETHOD.

    #define SL_SO_SEC_METHOD_SSLV3 (0) /* security metohd SSL v3*/
    #define SL_SO_SEC_METHOD_TLSV1 (1) /* security metohd TLS v1*/
    #define SL_SO_SEC_METHOD_TLSV1_1 (2) /* security metohd TLS v1_1*/
    #define SL_SO_SEC_METHOD_TLSV1_2 (3) /* security metohd TLS v1_2*/
    #define SL_SO_SEC_METHOD_SSLv3_TLSV1_2 (4) /* use highest possible version from SSLv3 - TLS 1.2*/
    #define SL_SO_SEC_METHOD_DLSV1 (5) /* security metohd DTL v1 */

    The cipher is the cipher suit that you select. It's defined in socket.h as
    #define SL_SEC_MASK_SSL_RSA_WITH_RC4_128_SHA (1 << 0)
    #define SL_SEC_MASK_SSL_RSA_WITH_RC4_128_MD5 (1 << 1)
    #define SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA (1 << 2)
    #define SL_SEC_MASK_TLS_DHE_RSA_WITH_AES_256_CBC_SHA (1 << 3)
    #define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (1 << 4)
    #define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_RC4_128_SHA (1 << 5)
    #define SL_SEC_MASK_TLS_RSA_WITH_AES_128_CBC_SHA256 (1 << 6)
    #define SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA256 (1 << 7)
    #define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (1 << 8)
    #define SL_SEC_MASK_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (1 << 9)

    Regards,
    Raghavendra