JaT fixes
This commit is contained in:
parent
738be0aa10
commit
e26477e8d1
Binary file not shown.
@ -9,6 +9,8 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.Proxy;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
@ -71,6 +73,8 @@ public abstract class AbstractProcess {
|
|||||||
|
|
||||||
public static ObjectMapper mapper;
|
public static ObjectMapper mapper;
|
||||||
public static ObjectMapper mapperYaml;
|
public static ObjectMapper mapperYaml;
|
||||||
|
|
||||||
|
public static Proxy proxy;
|
||||||
|
|
||||||
public final RegistryClient client;
|
public final RegistryClient client;
|
||||||
|
|
||||||
@ -89,6 +93,9 @@ public abstract class AbstractProcess {
|
|||||||
config = ConfigManager.getInstance().getConfig();
|
config = ConfigManager.getInstance().getConfig();
|
||||||
|
|
||||||
setTrustStoreCredentials();
|
setTrustStoreCredentials();
|
||||||
|
|
||||||
|
if (config.getProxy() != null && config.getProxy().getHost() != null && !config.getProxy().getHost().isEmpty())
|
||||||
|
proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(config.getProxy().getHost(), config.getProxy().getPort()));
|
||||||
|
|
||||||
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() {
|
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() {
|
||||||
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
|
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
|
||||||
@ -338,7 +345,7 @@ public abstract class AbstractProcess {
|
|||||||
|
|
||||||
URL url = new URL(urlStr);
|
URL url = new URL(urlStr);
|
||||||
|
|
||||||
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
|
HttpsURLConnection con = (HttpsURLConnection) url.openConnection(proxy);
|
||||||
con.setRequestMethod("POST");
|
con.setRequestMethod("POST");
|
||||||
con.setDoInput(true);
|
con.setDoInput(true);
|
||||||
con.setDoOutput(true);
|
con.setDoOutput(true);
|
||||||
@ -450,7 +457,7 @@ public abstract class AbstractProcess {
|
|||||||
|
|
||||||
URL url = new URL(urlStr);
|
URL url = new URL(urlStr);
|
||||||
|
|
||||||
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
|
HttpsURLConnection con = (HttpsURLConnection) url.openConnection(proxy);
|
||||||
con.setUseCaches(false);
|
con.setUseCaches(false);
|
||||||
con.setDoOutput(true);
|
con.setDoOutput(true);
|
||||||
configureHttpsConnection(con);
|
configureHttpsConnection(con);
|
||||||
|
|||||||
@ -21,6 +21,8 @@ public class ApplicationConfig {
|
|||||||
private int maxThreads;
|
private int maxThreads;
|
||||||
@JsonProperty("store_migrated_artifacts")
|
@JsonProperty("store_migrated_artifacts")
|
||||||
private boolean storeMigratedArtifacts = false;
|
private boolean storeMigratedArtifacts = false;
|
||||||
|
@JsonProperty("proxy")
|
||||||
|
private Proxy proxy;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class TrustStore {
|
public static class TrustStore {
|
||||||
@ -66,4 +68,16 @@ public class ApplicationConfig {
|
|||||||
private String wso2ApisDir;
|
private String wso2ApisDir;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Proxy {
|
||||||
|
@JsonProperty("host")
|
||||||
|
private String host;
|
||||||
|
@JsonProperty("port")
|
||||||
|
private int port;
|
||||||
|
@JsonProperty("username")
|
||||||
|
private String username;
|
||||||
|
@JsonProperty("password")
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,3 +1,7 @@
|
|||||||
|
proxy:
|
||||||
|
host: proxy.jtfg.com
|
||||||
|
port: 3128
|
||||||
|
|
||||||
source:
|
source:
|
||||||
registration_api_url: https://developerstest.jtfg.com/client-registration/v0.17/register
|
registration_api_url: https://developerstest.jtfg.com/client-registration/v0.17/register
|
||||||
publisher_api_url: https://developerstest.jtfg.com/api/am/publisher
|
publisher_api_url: https://developerstest.jtfg.com/api/am/publisher
|
||||||
@ -8,12 +12,12 @@ source:
|
|||||||
wso2_apis_dir: apis
|
wso2_apis_dir: apis
|
||||||
|
|
||||||
target:
|
target:
|
||||||
registration_api_url: https://localhost:9443/client-registration/v0.17/register
|
registration_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/client-registration/v0.17/register
|
||||||
publisher_api_url: https://localhost:9443/api/am/publisher/v4/apis/import
|
publisher_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/publisher/v4/apis/import
|
||||||
admin_api_url: https://localhost:9443/api/am/admin/v4
|
admin_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/admin/v4
|
||||||
devportal_api_url: https://localhost:9443/api/am/devportal
|
devportal_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/devportal
|
||||||
publisher_token_url: https://localhost:9443/oauth2/token
|
publisher_token_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/oauth2/token
|
||||||
wso2_user: YWRtaW46YWRtaW4=
|
wso2_user: YWRtaW46Tiw5YzEpeFh0NTNr
|
||||||
|
|
||||||
truststore:
|
truststore:
|
||||||
path: client-truststore.jks
|
path: client-truststore.jks
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user