Octave urlread will not load data due to "Pee

I am using Octave 4.0.0 for Windows and want to download stock prices from a webpage open to everyone. I use the following call:

data = urlread(https://www.netfonds.no/quotes/paperhistory.php?paper=API.A&csv_format=csv)

However, I get the following error message:

urlread: Peer certificate cannot be authenticated with given CA certificates

I searched the internet, including StackOverflow, for this error message, but don’t understand what tips are listed there.

Q1: Is something missing on my computer? If so, what should I do?
Q2: Can I change the call in some way to adapt to something missing on my computer?

Thanks in advance for any help :)

+4
source share
3 answers

This seems to be a bug in urlread()for some versions of Octave. For the course I am doing, we changed this:

responseBody = urlread(submissionUrl, 'post', params);

to

[code, responseBody] = system(sprintf('echo jsonBody=%s | curl -k -X POST -d @- %s', body, submissionUrl));

+6

, . , , . , , - ( ). , .

, , , -, , , -, urlread "". , . - , , . - , libcurl (, urlread) , .

"" .pem . , -, GlobalSign_Root_CA_-_R2.pem.

:

octave> data = urlread ("https://www.netfonds.no/quotes/paperhistory.php?paper=API.A&csv_format=csv")
data = quote_date,paper,exch,open,high,low,close,volume,value
20150508,API,Amex,0.39,0.40,0.39,0.40,85933,34194
20150507,API,Amex,0.40,0.41,0.38,0.39,163325,64062
...
+1

For Windows, a workaround is to use the curl command in the Windows console. This can be invoked by Octave through a system command. With the curl command, you can select the option “- insecure”, which will also allow you to connect to websites without certificates. Use this option only if you are sure that the site is safe.

sURLLink = 'https://www.netfonds.no/quotes/paperhistory.php?paper=API.A&csv_format=csv'
command=['curl --insecure ','"',sURLLink,'"']; 
[status, output] =system(command);
0
source

All Articles