使用TCL请求HTTPS时出现问题 [英] Problem requesting a HTTPS with TCL

查看:307
本文介绍了使用TCL请求HTTPS时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用TCL(Op​​enACS)进行以下请求

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

问题是当我读取$ status变量时,我得到"eof",而$ answer变量变为空.我尝试启用tls V.1

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]

,它仅适用于站点 https://www.galileo.edu ,而不适用于 https://encrypted.google.com .

and it works only for the site https://www.galileo.edu, but not for https://encrypted.google.com.

我要连接的网站是 https://graph.facebook.com /me/feed?access_token = ... 但这不起作用.

The site what I'm trying to connect is https://graph.facebook.com/me/feed?access_token=... but it doesn't work.

我使用curl来获取HTTPS中页面的内容,并且可以正常工作,因为我已经安装了OpenSSL,所以我看不到问题,还有另一种方法可以与TCL建立HTTPS连接.

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?.

我看不到这是否是编码问题(也许我注册了错误的https协议),或者这是服务器的配置错误.希望有人帮助!谢谢!

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!

推荐答案

嗯,我无法复制.您使用的是哪个Tcl补丁级别,以及哪个版本的tls软件包?

Hmm, I can't reproduce that. Which patchlevel of Tcl are you using, and which version of the tls package?

我这样做了:

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的版本.

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.

这篇关于使用TCL请求HTTPS时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆