我希望下载驻留在服务器上的文件。我正在设置令牌并下载数据。
package require http
package require twapi_crypto
http::register https 443 [list ::twapi::tls_socket]
set token [http::geturl "https://$ipaddress/filename"]
set status [http::status $token]
set data [http::data $token]
put $data
当我运行此代码时,它会出现以下错误:
The certificate chain was issued by an authority that is not trusted
while executing
"InitializeSecurityContext $Credentials $Handle $Target $Inattr 0 $Datarep $inbuflist 0"
(procedure "sspi_step" line 16)
invoked from within
"sspi_step $SpiContext $data"
(procedure "_negotiate2" line 19)
invoked from within
"_negotiate2 $chan"
(procedure "rethrow" line 2)
invoked from within
"rethrow"
invoked from within
"trap {
_negotiate2 $chan
} onerror {} {
variable channels
if {[info exists _channels($chan)]} {
dict set _chan..."
(procedure "_negotiate line 3)
invoked from within
"_negotiate $chan"
(procedure "::twapi::tls::_so_write_andler" line12)
invoked from within
"::twapi::tls::_so_write_handle rc0"
我不知道我在这里做错了什么。类似的代码在Linux中使用tls实现,它工作正常。所有这些都来自一个exe,我使用starkit来制作一个exe。
除了twapi之外,还有其他方法可以在Windows中使用https连接吗? 我不确定,但我在Windows中使用了tls,但是geturl ncode返回null值。这可能是因为没有在Windows机器上安装SSL吗?
PS:在TWAPI Bug #154中可以找到类似的错误,但未给出解决方案。