From c21d973977a9f1d00d26179de764687ddd0ec56c Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 24 四月 2024 14:59:41 +0800
Subject: [PATCH] 修复收到catalog消息是更新导致是否有音频的设置失效的BUG

---
 src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java
index cb0d3dd..5735f37 100644
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java
@@ -2,9 +2,8 @@
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.genersoft.iot.vmp.conf.exception.ControllerException;
 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
-import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
+import com.genersoft.iot.vmp.utils.SSLSocketClientUtil;
 import okhttp3.*;
 import okhttp3.logging.HttpLoggingInterceptor;
 import org.jetbrains.annotations.NotNull;
@@ -13,11 +12,10 @@
 import org.springframework.stereotype.Component;
 import org.springframework.util.ObjectUtils;
 
+import javax.net.ssl.X509TrustManager;
 import java.io.IOException;
 import java.net.ConnectException;
-import java.net.MalformedURLException;
 import java.net.SocketTimeoutException;
-import java.net.URL;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -40,7 +38,7 @@
     private OkHttpClient getClient(){
         return getClient(null);
     }
-    
+
     private OkHttpClient getClient(Integer readTimeOut){
         if (client == null) {
             if (readTimeOut == null) {
@@ -61,6 +59,10 @@
                 // OkHttp閫茶娣诲姞鏀旀埅鍣╨oggingInterceptor
                 httpClientBuilder.addInterceptor(logging);
             }
+            X509TrustManager manager = SSLSocketClientUtil.getX509TrustManager();
+            // 璁剧疆ssl
+            httpClientBuilder.sslSocketFactory(SSLSocketClientUtil.getSocketFactory(manager), manager);
+            httpClientBuilder.hostnameVerifier(SSLSocketClientUtil.getHostnameVerifier());//蹇界暐鏍¢獙
             client = httpClientBuilder.build();
         }
         return client;
@@ -249,7 +251,7 @@
 
     public JSONObject addTask(MediaServerItem mediaServerItem, String app, String stream, String startTime,
                               String endTime, String callId, List<String> filePathList, String remoteHost) {
-        
+
         JSONObject videoTaskInfoJSON = new JSONObject();
         videoTaskInfoJSON.put("app", app);
         videoTaskInfoJSON.put("stream", stream);

--
Gitblit v1.8.0