How 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.
It 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");
endif
Running urlread from the command window shows the error below.
>> [html, status, msg] = urlread ("http://packages.octave.org/list_packages.php");
>> msg
msg = Peer certificate cannot be authenticated with given CA certificates
Tried google.com over HTTPS and the same.
>> [html, status, msg] = urlread ("https://google.com");
>> msg
msg = Peer certificate cannot be authenticated with given CA certificates
IE 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");
endif
However it caused another error.
>> 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
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.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With