From 8072763c0d2671a557018ae7e7a99dffb5ff424a Mon Sep 17 00:00:00 2001 From: chenyong <1521761801@qq.com> Date: Wed, 14 Nov 2018 18:07:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenyong <1521761801@qq.com> --- README.md | 7 +++++++ docs/user-guide.md | 15 +++++++++++---- src/webclient.c | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 53f745f..0545eb3 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,9 @@ RT-Thread online packages [*] WebClient: A HTTP/HTTPS Client for RT-Thread [ ] Enable webclient GET/POST samples Select TLS mode (Not support) ---> + (x) Not support + ( ) SAL TLS support + ( ) MbedTLS support Version (latest) ---> ``` @@ -66,6 +69,10 @@ RT-Thread online packages **Select TLS mode** :配置开启 HTTPS 支持,选择支持的模式; +- **Not support**:不支持 TLS 功能; +- **SAL TLS support**:配置 SAL 组件中 TLS 功能支持,SAL 组件中抽象 TLS 操作,用户还需要**手动配置开启使用的 TLS 软件包类型**(目前只支持 MbedTLS 软件包); +- **MbedTLS support**:配置 MbedTLS 功能支持; + **Version** :配置软件包版本。 配置完成后让 RT-Thread 的包管理器自动更新,或者使用 pkgs --update 命令更新包到 BSP 中。 diff --git a/docs/user-guide.md b/docs/user-guide.md index afa3419..176cf75 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -13,16 +13,23 @@ ```shell RT-Thread online packages IoT - internet of things ---> - [*] WebClient: A HTTP/HTTPS Client for RT-Thread - [ ] Enable webclient GET/POST samples - Select TLS mode (Not support) ---> - Version (latest) ---> + [*] WebClient: A HTTP/HTTPS Client for RT-Thread + [ ] Enable webclient GET/POST samples + Select TLS mode (Not support) ---> + (x) Not support + ( ) SAL TLS support + ( ) MbedTLS support + Version (latest) ---> ``` **Enable webclient GET/POST samples** :添加示例代码; **Select TLS mode** :配置开启 HTTPS 支持,选择支持的模式; +- **Not support**:不支持 TLS 功能; +- **SAL TLS support**:配置 SAL 组件中 TLS 功能支持,SAL 组件中抽象 TLS 操作,用户还需要**手动配置开启使用的 TLS 软件包类型**(目前只支持 MbedTLS 软件包); +- **MbedTLS support**:配置 MbedTLS 功能支持; + **Version** :配置软件包版本号。 选择合适的配置项后,使用 `pkgs --update` 命令下载软件包并更新用户配置。 diff --git a/src/webclient.c b/src/webclient.c index 9ca2a17..1a12202 100644 --- a/src/webclient.c +++ b/src/webclient.c @@ -434,7 +434,7 @@ static int webclient_connect(struct webclient_session *session, const char *URI) #ifdef WEBCLIENT_USING_SAL_TLS if (session->is_tls) { - socket_handle = socket(res->ai_family, SOCK_STREAM, PROTOCOL_TLS_MBED); + socket_handle = socket(res->ai_family, SOCK_STREAM, PROTOCOL_TLS); } else {