本文介绍了MATLAB:如何让urlread2与HTTPS协同工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试使用 urlread2 从网站抓取数据时,我收到一条错误消息,其中包含以下Java异常:'无法生成DH密钥对'

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'

过去,我曾使用HTTP有效地使用 urlread2 。这个事实加上上面的Java异常使得很容易确定 urlread2 在协商SSL握手时遇到了问题,这就提出了一个问题......

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...

如何让urlread2与HTTPS协同工作?

How can I get urlread2 to work with HTTPS?

推荐答案

在研究问题时,我来了这个Stack Overflow问题:

In researching the problem, I came across this Stack Overflow question:

一个答案建议升级到最新的JDK(截至目前为1.8.0_73)。我做到了,但我的代码仍无效。我想到MATLAB可能有一个可能需要更改的默认Java虚拟机(JVM)设置,因此我查找了有关如何执行此操作的说明。

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

此处:

升级到最新的JDK并更改MATLAB的默认JVM设置后, urlread2 现在适用于HTTPS。

After upgrading to the latest JDK and changing the default JVM settings for MATLAB, urlread2 now works with HTTPS.

这篇关于MATLAB:如何让urlread2与HTTPS协同工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 23:09