Merge pull request #54 from ucloud/bugfix_add_http_auth_url
add http auth url
This commit is contained in:
commit
d20db71caa
|
@ -21,6 +21,7 @@
|
|||
#include "lite-utils.h"
|
||||
#include "ca.h"
|
||||
#include "utils_sha2.h"
|
||||
#include "uiot_export.h"
|
||||
|
||||
int IOT_HTTP_Get_Token(const char *product_sn, const char *device_sn, const char *device_sercret, char *token)
|
||||
{
|
||||
|
@ -87,9 +88,8 @@ int IOT_HTTP_Get_Token(const char *product_sn, const char *device_sn, const char
|
|||
HAL_Snprintf(http_client_post->header, 1024, "Content-Type: application/json\r\nAuthorization: %s\r\nbody: %s\r\n",mac_output_char,http_data_post->post_buf);
|
||||
|
||||
const char *ca_crt = iot_https_ca_get();
|
||||
char *url = (char *)"https://http-cn-sh2.iot.ucloud.cn/auth";
|
||||
|
||||
ret = http_client_common(http_client_post, url, 443, ca_crt, HTTP_POST, http_data_post,5000);
|
||||
ret = http_client_common(http_client_post, UIOT_AUTH_URL, 443, ca_crt, HTTP_POST, http_data_post,5000);
|
||||
if(SUCCESS_RET != ret)
|
||||
{
|
||||
LOG_ERROR("HTTP_POST error\n");
|
||||
|
|
|
@ -57,14 +57,15 @@ extern "C" {
|
|||
/* MQTT连接域名 */
|
||||
//上海区域域名
|
||||
#define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-sh2.iot.ucloud.cn"
|
||||
#define UIOT_AUTH_URL "https://http-cn-sh2.iot.ucloud.cn/auth"
|
||||
#define UIOT_UPLOAD_FILE_URL "https://file-cn-sh2.iot.ucloud.cn/api/v1/url"
|
||||
|
||||
/*
|
||||
//使用广州区域时替换为
|
||||
#define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-gd.iot.ucloud.cn"
|
||||
#define UIOT_AUTH_URL "https://http-cn-gd.iot.ucloud.cn/auth"
|
||||
#define UIOT_UPLOAD_FILE_URL "https://file-cn-gd.iot.ucloud.cn/api/v1/url"
|
||||
*/
|
||||
|
||||
#include "uiot_export_mqtt.h"
|
||||
#include "uiot_defs.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue