Plotly matlab offline Java error: Received fatal alert: protocol_version


#1

Some people including me have this problem: when you use this command to get the offline package:
getplotlyoffline(‘https://cdn.plot.ly/plotly-latest.min.js’)
Matlab returns error:
Response stream is undefined
below is a Java Error dump (truncated):
Error using urlread2 (line 217)
Java exception occurred:
javax.net.ssl.SSLException: Received fatal alert: protocol_version

After a long time searching, I found this could be either a certificate issue or a Java SSL protocol issue.
These problems can be fixed by:
1). add Certificate of https://cdn.plot.ly/plotly-latest.min.js following the steps here:
https://www.mathworks.com/matlabcentral/answers/92506-how-can-i-configure-matlab-to-allow-access-to-self-signed-https-servers
Answer by Chirag Patel on 9 Mar 2017:
Step1: Go to Google Chrome: Access same URL: Download Certificate (call it myCert.cer)
Step2: Download importcert.m and execute >> importcert(‘myCert.cer’)
Step3: Restart MATLAB

2). Using HTTP instead of HTTPS (https://github.com/Athou/commafeed/issues/672). This will fix the Java SSL protocol issue.
So use command : getplotlyoffline(‘http://cdn.plot.ly/plotly-latest.min.js’) to get the package.

For me I did step 1, but the error was still there. Then I did step 2, the error is gone.
When you got the package sucessfully, it will say:

getplotlyoffline(‘http://cdn.plot.ly/plotly-latest.min.js’)
Success! You can generate your first offline graph
using the ‘offline’ flag of fig2plotly as follows:

plot(1:10); fig2plotly(gcf, ‘offline’, true);

Then you can start to use the offline mode. Hope this will help you!

Qi