|
|
@@ -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) {
|