While trying to scrape data from a website using urlread2, I got an error message with the following Java exception: 'Could not generate DH keypair'
In the past, I had used urlread2 effectively with HTTP. That fact combined with the Java exception above made it easy to determine that urlread2 was having problems negotiating the SSL handshake, which begged the question...
How can I get urlread2 to work with HTTPS?
In researching the problem, I came across this Stack Overflow question:
Java: Why does SSL handshake give 'Could not generate DH keypair' exception?
One answer suggested upgrading to the latest JDK (1.8.0_73 as of now.) I did that, but my code still didn't work. It occurred to me that MATLAB might have a default Java Virtual Machine (JVM) setting that might need to be changed, so I looked for instructions on how to do that.
I found such instructions here: Change MATLAB Compiler Runtime jvm version
And here: Matlab Central: How do I change the Java Virtual Machine?
After upgrading to the latest JDK and changing the default JVM settings for MATLAB, urlread2 now works with HTTPS.
برچسب:
نویسنده: استخدام کار
تاريخ: چهارشنبه
28 بهمن
1394 ساعت: 10:11