필터 지우기
필터 지우기

Using TLSv1.2 with webread

조회 수: 17 (최근 30일)
Andrew Stamps
Andrew Stamps 2018년 5월 17일
편집: MathWorks Support Team 2024년 5월 21일
I have been consuming a RESTful API for a secure web service my company supports using webread. However, they recently disabled TLSv1 connections for security reasons, and they now require TLSv1.1 or TLSv1.2. This seems to have broken my code. Is anyone aware of a way to change settings such that TLSv1.1 or TLSv1.2 would be used with webread or am I looking at trying to replicate this functionality using .NET?
  댓글 수: 1
Paolo
Paolo 2018년 5월 18일
weboptions allows you to add HTTP headers. You can add the HTTP header you require to weboptions with the 'KeyName' and 'KeyValue' pairs.
Alternatively, you can use 'curl' which allows you to specify directly the tls version.

댓글을 달려면 로그인하십시오.

채택된 답변

Aylin
Aylin 2024년 5월 21일
편집: MathWorks Support Team 2024년 5월 21일
For MATLAB R2019b and newer, webread natively supports TLS >= 1.1. For MATLAB R2019a and older, TLS 1.2 support can be enabled in MATLAB versions which use Java 1.7 by adding the following Java startup option: -Dhttps.protocols=TLSv1.2 to a java.opts file and then restarting MATLAB. Please refer to the following documentation page for more information on creating a java.opts file and specifying MATLAB's JVM startup options: https://www.mathworks.com/help/matlab/matlab_env/java-opts-file.html
  댓글 수: 2
Ricardo MF
Ricardo MF 2021년 8월 19일
Dear Rylan, I have an R2014a matlab version and java Version: Java 1.7.0_11-b21.
I am trying to enable the TLS 1.2 support using your suggested option '-Dhttps.protocols=TLSv1.2'. I have not found an java.opts file in my installed version, so I created one and inserted at the root folder but it seems matlab does not load it. Is there another method to configure this protocol into the java at matlab? tks in advance
Ricardo MF
Ricardo MF 2021년 8월 19일
Problem solved. Matlab incorporated the TLS instruction as suggested and solved the problem with urlread/urlwrite. Tks a lot. Best regards.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by