|  |  | 
 |  |  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  |     private OkHttpClient getClient(){ | 
 |  |  |         return getClient(null); | 
 |  |  |     } | 
 |  |  |      | 
 |  |  |  | 
 |  |  |     private OkHttpClient getClient(Integer readTimeOut){ | 
 |  |  |         if (client == null) { | 
 |  |  |             if (readTimeOut == null) { | 
 |  |  | 
 |  |  |                 // OkHttp進行添加攔截器loggingInterceptor | 
 |  |  |                 httpClientBuilder.addInterceptor(logging); | 
 |  |  |             } | 
 |  |  |             X509TrustManager manager = SSLSocketClientUtil.getX509TrustManager(); | 
 |  |  |             // 设置ssl | 
 |  |  |             httpClientBuilder.sslSocketFactory(SSLSocketClientUtil.getSocketFactory(manager), manager); | 
 |  |  |             httpClientBuilder.hostnameVerifier(SSLSocketClientUtil.getHostnameVerifier());//忽略校验 | 
 |  |  |             client = httpClientBuilder.build(); | 
 |  |  |         } | 
 |  |  |         return client; | 
 |  |  | 
 |  |  |  | 
 |  |  |     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); |