diff --git a/src/main/java/com/hcl/appscan/sdk/scanners/ASoCScan.java b/src/main/java/com/hcl/appscan/sdk/scanners/ASoCScan.java index 92fe4dae..cb740f98 100644 --- a/src/main/java/com/hcl/appscan/sdk/scanners/ASoCScan.java +++ b/src/main/java/com/hcl/appscan/sdk/scanners/ASoCScan.java @@ -1,6 +1,6 @@ /** * © Copyright IBM Corporation 2016. - * © Copyright HCL Technologies Ltd. 2017. + * © Copyright HCL Technologies Ltd. 2017, 2024. * LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 */ @@ -33,7 +33,7 @@ public ASoCScan(Map properties, IScanServiceProvider provider) { } public ASoCScan(Map properties, IProgress progress, IScanServiceProvider provider) { - m_target = properties.remove(CoreConstants.TARGET); + m_target = properties.get(CoreConstants.TARGET); m_properties = properties; if(!m_properties.containsKey(CoreConstants.SCAN_NAME)) m_properties.put(CoreConstants.SCAN_NAME, getType() + SystemUtil.getTimeStamp()); diff --git a/src/main/java/com/hcl/appscan/sdk/scanners/dynamic/DASTScan.java b/src/main/java/com/hcl/appscan/sdk/scanners/dynamic/DASTScan.java index 6d357c01..de541599 100644 --- a/src/main/java/com/hcl/appscan/sdk/scanners/dynamic/DASTScan.java +++ b/src/main/java/com/hcl/appscan/sdk/scanners/dynamic/DASTScan.java @@ -49,7 +49,7 @@ public void run() throws ScannerException, InvalidTargetException { params.put(STARTING_URL, target); IAuthenticationProvider authProvider = getServiceProvider().getAuthenticationProvider(); - if(params.get(PRESENCE_ID)!=null && params.get(PRESENCE_ID).isEmpty() && !ServiceUtil.isValidUrl(target, authProvider, authProvider.getProxy())) { + if(!params.containsKey(PRESENCE_ID) && !ServiceUtil.isValidUrl(target, authProvider, authProvider.getProxy())) { throw new ScannerException(Messages.getMessage(CoreConstants.ERROR_URL_VALIDATION, target)); } diff --git a/src/main/java/com/hcl/appscan/sdk/utils/ServiceUtil.java b/src/main/java/com/hcl/appscan/sdk/utils/ServiceUtil.java index 48ffc51d..23642fca 100644 --- a/src/main/java/com/hcl/appscan/sdk/utils/ServiceUtil.java +++ b/src/main/java/com/hcl/appscan/sdk/utils/ServiceUtil.java @@ -1,6 +1,6 @@ /** * © Copyright IBM Corporation 2016. - * © Copyright HCL Technologies Ltd. 2017, 2020, 2023. + * © Copyright HCL Technologies Ltd. 2017, 2020, 2024. * LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 */ @@ -142,9 +142,9 @@ public static boolean isValidUrl(String url, IAuthenticationProvider provider, P JSONObject body = new JSONObject(); body.put(URL, url); - HttpClient client = new HttpClient(proxy); - Map requestHeaders= provider.getAuthorizationHeader(false); - requestHeaders.put("Content-Type", "application/json"); + HttpClient client = new HttpClient(proxy, provider.getacceptInvalidCerts()); + Map requestHeaders= provider.getAuthorizationHeader(false); + requestHeaders.put("Content-Type", "application/json"); HttpResponse response = client.post(request_url, requestHeaders, body.toString()); if (response.isSuccess()) {