RT-Thread-packages/webclient

wget使用时http和https问题

flyranchao opened this issue · 2 comments

你好:
我在使用wget时遇到如下两个问题,麻烦帮忙看看.感激.
1.链接明明是http怎么提示需要enable https configure.
msh />webclient_pull http://www.rt-thread.com /service/rt-thread.txt
[E/web] not support https connect, please enable webclient https configure!
[E/web.file] get file failed, wrong response: -1 (-0xFFFFFFFF).
msh />
2.配置了mebdtls作为加密方式,又出现如下问题.
[E/mbedtls.clnt] verify peer certificate fail....
[E/mbedtls.clnt] verification info: ! The certificate is not correctly signed by the trusted CA
! The certificate validity starts in the future
好像是证书不对?
msh />webclient_pull http://www.rt-thread.com /service/rt-thread.txt
[D/mbedtls.clnt] Set debug level (2)
[D/mbedtls.clnt] mbedtls client struct init success...
[D/mbedtls.clnt] Loading the CA root certificate success...
[D/mbedtls.clnt] mbedtls client context init success...
[D/mbedtls.clnt] Connected www.rt-thread.org:443 success...
[D/mbedtls.clnt] mbedtls_ssl_handshake:6651: => handshake

[D/mbedtls.clnt] mbedtls_ssl_handshake_client_step:3321: client state: 0

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2446: => flush output

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2458: <= flush output

[D/mbedtls.clnt] mbedtls_ssl_handshake_client_step:3321: client state: 1

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2446: => flush output

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2458: <= flush output

[D/mbedtls.clnt] ssl_write_client_hello:0730: => write client hello

[D/mbedtls.clnt] mbedtls_ssl_write_record:2731: => write record

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2446: => flush output

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2464: message length: 410, out_left: 410

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2471: ssl->f_send() returned 410 (-0xfffffe66)

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2490: <= flush output

[D/mbedtls.clnt] mbedtls_ssl_write_record:2889: <= write record

[D/mbedtls.clnt] ssl_write_client_hello:1064: <= write client hello

[D/mbedtls.clnt] mbedtls_ssl_handshake_client_step:3321: client state: 2

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2446: => flush output

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2458: <= flush output

[D/mbedtls.clnt] ssl_parse_server_hello:1457: => parse server hello

[D/mbedtls.clnt] mbedtls_ssl_read_record:3767: => read record

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2234: => fetch input

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2391: in_left: 0, nb_want: 5

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2415: in_left: 0, nb_want: 5

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2417: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2433: <= fetch input

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2234: => fetch input

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2391: in_left: 5, nb_want: 70

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2415: in_left: 5, nb_want: 70

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2417: ssl->f_recv(_timeout)() returned 65 (-0xffffffbf)

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2433: <= fetch input

[D/mbedtls.clnt] mbedtls_ssl_read_record:3800: <= read record

[D/mbedtls.clnt] ssl_parse_server_hello:1741: server hello, total extension length: 21

[D/mbedtls.clnt] ssl_parse_server_hello:1930: <= parse server hello

[D/mbedtls.clnt] mbedtls_ssl_handshake_client_step:3321: client state: 3

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2446: => flush output

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2458: <= flush output

[D/mbedtls.clnt] mbedtls_ssl_parse_certificate:4366: => parse certificate

[D/mbedtls.clnt] mbedtls_ssl_read_record:3767: => read record

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2234: => fetch input

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2391: in_left: 0, nb_want: 5

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2415: in_left: 0, nb_want: 5

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2417: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2433: <= fetch input

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2234: => fetch input

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2391: in_left: 5, nb_want: 2652

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2415: in_left: 5, nb_want: 2652

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2417: ssl->f_recv(_timeout)() returned 2647 (-0xfffff5a9)

[D/mbedtls.clnt] mbedtls_ssl_fetch_input:2433: <= fetch input

[D/mbedtls.clnt] mbedtls_ssl_read_record:3800: <= read record

[D/mbedtls.clnt] mbedtls_ssl_parse_certificate:4633: x509_verify_cert() returned -9984 (-0x2700)

[D/mbedtls.clnt] mbedtls_ssl_send_alert_message:4170: => send alert message

[D/mbedtls.clnt] mbedtls_ssl_write_record:2731: => write record

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2446: => flush output

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2464: message length: 7, out_left: 7

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2471: ssl->f_send() returned 7 (-0xfffffff9)

[D/mbedtls.clnt] mbedtls_ssl_flush_output:2490: <= flush output

[D/mbedtls.clnt] mbedtls_ssl_write_record:2889: <= write record

[D/mbedtls.clnt] mbedtls_ssl_send_alert_message:4183: <= send alert message

[D/mbedtls.clnt] mbedtls_ssl_parse_certificate:4730: <= parse certificate

[D/mbedtls.clnt] mbedtls_ssl_handshake:6661: <= handshake

[E/mbedtls.clnt] verify peer certificate fail....
[E/mbedtls.clnt] verification info: ! The certificate is not correctly signed by the trusted CA
! The certificate validity starts in the future

[E/web] connect failed, https client connect return: -0x1
[E/web.file] get file failed, wrong response: -6 (-0xFFFFFFFA).
[D/mbedtls.clnt] mbedtls_ssl_close_notify:7282: => write close notify

[D/mbedtls.clnt] mbedtls_ssl_close_notify:7298: <= write close notify

你电脑抓一下应该可以看到rtt官网会做一次301跳转,跳转后的链接是https的

你的链接字符串中间有个空格,这样访问将不是同一个地址了。

http://www.rt-thread.com/service/rt-thread.txt

这个地址是测试专用的,不会跳到 https