Matlab / GNU Octave SSL certificates
SSL certificate checking can add security to web operations. Some systems may need environment variable SSL_CERT_FILE for Matlab’s vendored cURL. As a last resort, certificate checking can be turned off, but this raises file integrity and security issues.
Instead of disabling certificate checking set environment variable SSL_CERT_FILE to the actual certificate location.
Matlab or GNU Octave use the factory function weboptions() to control HTTP behavior for functions like websave() and webread(), including Timeout and SSL certificate.
This example sets reply timeout to 15 seconds and specifies custom SSL certificate location when environment variable SSL_CERT_FILE is set.
cert = getenv("SSL_CERT_FILE")
if isfile(cert)
web_opts = weboptions(CertificateFilename=cert, Timeout=15);
else
web_opts = weboptions(Timeout=15);
end
data = webread(url, opts);
Alternative: cURL with Matlab
Related: Git SSL certificate location