如何修复(不是解决方法)Octave(假设与octave捆绑的libcurl)urlread导致 对等证书无法使用给定的CA证书进行身份验证 ?
阅读pkg install from forge in windows后,看起来Octave维护者知道Octave 4.0的问题,但似乎无法修复。
看起来Windows上的Octave的urlread对HTTPS不起作用,因为https://octave.sourceforge.io等服务器证书无法使用urlread(看起来像curl)引用的可信证书进行身份验证。
例如,在尝试运行 pkg install -forge 安装包。
## Try get the list of all packages.
[html, succ] = urlread ("http://packages.octave.org/list_packages.php");
if (! succ)
error ("get_forge_pkg: could not read URL, please verify internet connection");
endif
从命令窗口运行urlread会显示以下错误。
>> [html, status, msg] = urlread ("http://packages.octave.org/list_packages.php");
>> msg
msg = Peer certificate cannot be authenticated with given CA certificates
通过HTTPS和同样的方式尝试google.com。
>> [html, status, msg] = urlread ("https://google.com");
>> msg
msg = Peer certificate cannot be authenticated with given CA certificates
IE和Google Chrome根证书可以验证sourceforge证书。
尝试系统如下。
#[html, succ] = urlread ("http://packages.octave.org/list_packages.php");
sURLLink="https://octave.sourceforge.io/list_packages.php"
command=['curl --insecure ','"',sURLLink,'"'];
[succ, html] = system(command)
#if (! succ)
if (succ != 0)
error ("get_forge_pkg: could not read URL, please verify internet connection");
endif
但是它引起了另一个错误。
>> pkg install -forge symbolic
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 559 100 559 0 0 389 0 0:00:01 0:00:01 --:--:-- 393
sURLLink = https://octave.sourceforge.io/list_packages.php
succ = 0
html = bim
bsltl
cgi
....
error: get_forge_pkg: package NAME exists, but index page not available
error: called from
get_forge_pkg at line 74 column 7
get_forge_download at line 26 column 12
pkg at line 382 column 29
答案 0 :(得分:2)
http://packages.octave.org/list_packages.php
返回。如果你使用-L,你会发现它会将你的两次重定向到HTTPS:// URL - 只是为了让你无论如何都被迫修复案例(1)。