Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASA 8392 #155

Merged
merged 10 commits into from
Jun 4, 2024
4 changes: 2 additions & 2 deletions src/main/java/com/hcl/appscan/sdk/scanners/ASoCScan.java
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down Expand Up @@ -33,7 +33,7 @@ public ASoCScan(Map<String, String> properties, IScanServiceProvider provider) {
}

public ASoCScan(Map<String, String> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/hcl/appscan/sdk/utils/ServiceUtil.java
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down Expand Up @@ -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<String,String> requestHeaders= provider.getAuthorizationHeader(false);
requestHeaders.put("Content-Type", "application/json");
HttpClient client = new HttpClient(proxy, provider.getacceptInvalidCerts());
Map<String,String> requestHeaders= provider.getAuthorizationHeader(false);
requestHeaders.put("Content-Type", "application/json");
HttpResponse response = client.post(request_url, requestHeaders, body.toString());

if (response.isSuccess()) {
Expand Down
Loading