cc3200: Force SSL method to be TLSV1.

The default setting of using the "highest" method available doesn't
work with some servers like Microsoft Azure. TLSV1 seems to work with
pretty much any server.
This commit is contained in:
danicampora 2015-11-06 00:07:59 +01:00
parent 1673e19cb9
commit 8cee03b118

View File

@ -103,6 +103,10 @@ STATIC mp_obj_t mod_ssl_wrap_socket(mp_uint_t n_args, const mp_obj_t *pos_args,
_i16 sd = ((mod_network_socket_obj_t *)args[0].u_obj)->sock_base.sd; _i16 sd = ((mod_network_socket_obj_t *)args[0].u_obj)->sock_base.sd;
_i16 _errno; _i16 _errno;
_u8 method = SL_SO_SEC_METHOD_TLSV1;
if ((_errno = sl_SetSockOpt(sd, SL_SOL_SOCKET, SL_SO_SECMETHOD, &method, sizeof(method))) < 0) {
goto socket_error;
}
if (keyfile && (_errno = sl_SetSockOpt(sd, SL_SOL_SOCKET, SL_SO_SECURE_FILES_PRIVATE_KEY_FILE_NAME, keyfile, strlen(keyfile))) < 0) { if (keyfile && (_errno = sl_SetSockOpt(sd, SL_SOL_SOCKET, SL_SO_SECURE_FILES_PRIVATE_KEY_FILE_NAME, keyfile, strlen(keyfile))) < 0) {
goto socket_error; goto socket_error;
} }