everydatestudy 3 سال پیش
والد
کامیت
716c555b53
1فایلهای تغییر یافته به همراه15 افزوده شده و 15 حذف شده
  1. 15 15
      eladmin-sign/src/main/java/me/zhengjie/sign/connector/HttpConnector.java

+ 15 - 15
eladmin-sign/src/main/java/me/zhengjie/sign/connector/HttpConnector.java

@@ -54,21 +54,21 @@ public class HttpConnector implements InitializingBean {
 
     @Override
     public void afterPropertiesSet() throws Exception {
-//        Path temp = Paths.get(new File(HttpConnector.class.getClassLoader().getResource("").getPath().concat(keyStorePath)).getAbsolutePath());
-//        Files.copy(HttpClient.class.getClassLoader().getResourceAsStream(keyStorePath), temp, StandardCopyOption.REPLACE_EXISTING);
-//        keyStorePath = temp.toFile().getPath();
-//        trustStorePath = keyStorePath;
-//        httpClient.config.connectTimeout = connectTimeout;
-//        httpClient.config.readTimeout = readTimeout;
-//        httpClient.httpConfig.userAgent = "TrustSign FEP";
-//        httpClient.httpConfig.contentType = MIMEType.FORM;
-//        httpClient.httpConfig.accept = MIMEType.JSON;
-//        if (isSSL) {
-//            httpClient.initSSL(keyStorePath, keyStorePassword.toCharArray(), trustStorePath, trustStorePassword.toCharArray());
-//        }
-//        if (!url.endsWith("/")) {
-//            url += "/";
-//        }
+        Path temp = Paths.get(new File(HttpConnector.class.getClassLoader().getResource("").getPath().concat(keyStorePath)).getAbsolutePath());
+        Files.copy(HttpClient.class.getClassLoader().getResourceAsStream(keyStorePath), temp, StandardCopyOption.REPLACE_EXISTING);
+        keyStorePath = temp.toFile().getPath();
+        trustStorePath = keyStorePath;
+        httpClient.config.connectTimeout = connectTimeout;
+        httpClient.config.readTimeout = readTimeout;
+        httpClient.httpConfig.userAgent = "TrustSign FEP";
+        httpClient.httpConfig.contentType = MIMEType.FORM;
+        httpClient.httpConfig.accept = MIMEType.JSON;
+        if (isSSL) {
+            httpClient.initSSL(keyStorePath, keyStorePassword.toCharArray(), trustStorePath, trustStorePassword.toCharArray());
+        }
+        if (!url.endsWith("/")) {
+            url += "/";
+        }
     }
 
     public String post(String uri, String data, String signature) {