向 TCL 请求 HTTPS 时出现问题

发布于 2024-10-10 04:51:25 字数 936 浏览 1 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

牵强ㄟ 2024-10-17 04:51:25

嗯,我无法重现这一点。您使用的是哪个 Tcl 补丁级别,以及哪个版本的 tls 软件包?

我这样做了:

package require http
package require tls

# This is your code, cut-n-pasted with blank lines removed
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

puts $status

它生成“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:

package require http
package require tls

# This is your code, cut-n-pasted with blank lines removed
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

puts $status

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文