证书进行身份验证

证书进行身份验证

本文介绍了修复Octave urlread导致Peer证书无法使用给定的CA证书进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 问题 如何修复(不是解决方法)Octave(假设与octave捆绑的libcurl)urlread导致 对等证书无法通过给出CA证书 ? 阅读 尝试系统如下。 #[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(命令) #if(!succ) if(succ!= 0) error(get_forge_pkg:无法读取URL,请验证互联网连接); endif 但是它导致了另一个错误。 >> pkg install -forge symbolic %总收到%%Xferd平均速度时间时间时间当前 Dload上传总花费左下限 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 .... 错误:get_forge_pkg:包名称存在,但索引页面不可用错误:在第74行从 get_forge_pkg调用第7栏 get_forge_download第26行第12栏 pkg第382行第29栏 相关信息 从Windows中的伪造安装pkg urlread(),urlwrite()不适用于Octave for Windows中的https页面 windows libcurl - 对等证书无法使用给定的ca证书进行身份验证 在Curl中获取错误 - 无法使用已知的CA证书对对等证书进行身份验证 SSL CA证书 - LibCurl C语言(Linux) 环境 octave-4.2.0-w64在Windows 7企业版64位版本6.1.7601 Service Pack 1 Build 7601上 Windows 10 Pro 64位上的Octave 4.0.3版本10.0.14393 Build 14393 解决方案 您收到对等证书无法通过身份验证错误,因为您的CA商店不包含必要的CA证书。您可以从此处获取更新的软件包 。 您尝试使用curl命令行工具不起作用的原因是您没有使用 - L, - location 选项告诉curl遵循重定向,所以你得到的回复是 http://packages.octave.org/list_packages.php 返回。如果您使用-L,您将看到它会将您重定向到HTTPS:// URL - 只是为了让您无论如何都被迫修复案例(1)。 QuestionHow to the fix (not workaround) for Octave (suppose libcurl bundled with octave) urlread causing Peer certificate cannot be authenticated with given CA certificates?Having read pkg install from forge in windows, it looks the Octave maintainer is aware of the issue with Octave 4.0 but it seems no fix is available.IssueIt looks the urlread of Octave on Windows does not work for HTTPS because the server certificate of such as https://octave.sourceforge.io cannot be authenticated with the trusted certificates which urlread (which seems to call curl) refers to.For example, share\octave\4.2.0\m\pkg\private\get_forge_pkg.m line 64 is causing the issue when trying to run pkg install -forge to install packages.## 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");endifRunning urlread from the command window shows the error below.>> [html, status, msg] = urlread ("http://packages.octave.org/list_packages.php");>> msgmsg = Peer certificate cannot be authenticated with given CA certificatesTried google.com over HTTPS and the same.>> [html, status, msg] = urlread ("https://google.com");>> msgmsg = Peer certificate cannot be authenticated with given CA certificatesIE and Google Chrome root certificates can verify the sourceforge certificate.Tried system as below.#[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");endifHowever it caused another error.>> pkg install -forge symbolic % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 559 100 559 0 0 389 0 0:00:01 0:00:01 --:--:-- 393sURLLink = https://octave.sourceforge.io/list_packages.phpsucc = 0html = bimbsltlcgi....error: get_forge_pkg: package NAME exists, but index page not availableerror: called from get_forge_pkg at line 74 column 7 get_forge_download at line 26 column 12 pkg at line 382 column 29Related informationpkg install from forge in windowsurlread(), urlwrite() don't work for https pages in Octave for Windowswindows libcurl - peer certificate cannot be authenticated with given ca certificatesGetting error in Curl - Peer certificate cannot be authenticated with known CA certificatesSSL CA Certificates - LibCurl C Language (Linux)Environmentoctave-4.2.0-w64 on Windows 7 Enterprise 64 bit Version 6.1.7601 Service Pack 1 Build 7601Octave 4.0.3 on Windows 10 Pro 64 bit Version 10.0.14393 Build 14393 解决方案You get the "Peer certificate cannot be authenticated" error because your CA store doesn't contain the necessary CA cert. You can get an updated bundle from here.The reason your attempt to use the curl command line tool doesn't work is that you didn't use -L, --location option to tell curl to follow redirects, so you just got the 303 response that http://packages.octave.org/list_packages.php returns. If you'd use -L, you'll see that it'll redirect you twice over to a HTTPS:// URL - only to have you be forced to fix case (1) anyway. 这篇关于修复Octave urlread导致Peer证书无法使用给定的CA证书进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-31 23:09