向 TCL 请求 HTTPS 时出现问题
我正在尝试使用 TCL (OpenACS) 执行以下请求
http::register https 443 tls::socket
set url "https://encrypted.google.com"
set token [http::geturl $url -timeout 30000]
set status [http::status $token]
set answer [http::data $token]
http::cleanup $token
http::unregister https
问题是,当我读取 $status 变量时,我得到“eof”并且 $answer 变量变为空。我尝试启用 tls V.1
http::register https 443 [list tls::socket -tls1 1]
,它仅适用于网站 https://www.galileo.edu,但是不适用于 https://encrypted.google.com。
我尝试连接的网站是 https://graph.facebook.com/me/ feed?access_token=... 但它不起作用。
我使用curl检索HTTPS页面的内容并且它有效,我已经安装了OpenSSL,所以我看不到问题,还有另一种方法可以与TCL进行HTTPS连接吗?
我看不出这是否是编码问题(也许我注册了错误的 https 协议),或者可能是我的服务器配置错误。希望有人帮忙!!谢谢!
I'm trying to do the following request using TCL (OpenACS)
http::register https 443 tls::socket
set url "https://encrypted.google.com"
set token [http::geturl $url -timeout 30000]
set status [http::status $token]
set answer [http::data $token]
http::cleanup $token
http::unregister https
The problem is that when I read the $status variable I get "eof" and the $answer variable becomes empty. I tried enabling tls V.1
http::register https 443 [list tls::socket -tls1 1]
and it works only for the site https://www.galileo.edu, but not for https://encrypted.google.com.
The site what I'm trying to connect is https://graph.facebook.com/me/feed?access_token=...
but it doesn't work.
I used curl to retrieve the contents of the pages in HTTPS and it works, I have installed OpenSSL, so I can't see the problem, there is another way to do HTTPS connections with TCL?.
I can't see if this is a problem of coding (maybe I'm registered wrong the https protocol) or maybe It is a bad configuration of my server. Hope somebody helps!! Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,我无法重现这一点。您使用的是哪个 Tcl 补丁级别,以及哪个版本的 tls 软件包?
我这样做了:
它生成“
ok
”作为输出,其中$status
的内容看起来也很可能(但太长,无法粘贴到此处)。这是 Tcl 8.5.2(我知道我需要升级)、http 2.7 和 tls 1.6。Hmm, I can't reproduce that. Which patchlevel of Tcl are you using, and which version of the tls package?
I did this:
And it produces “
ok
” as output, with$status
's contents looking likely too (but too long to paste here). This is with Tcl 8.5.2 (I know I need to upgrade), http 2.7 and tls 1.6.