Not able to download file in chrome and it throws 'Insecure download blocked' warning for IP-based url

Hi ,
I want to download file but on clicking the file, it throws warning ‘Insecure download blocked’ with ‘keep’ button.
I tried to include this line for autodownload file ‘prefs.put(“profile.default_content_setting_values.automatic_downloads”, 1)’ and it works for AWS based URL but when I run the same script with IP-Based URL , its not working .

How to overcome this issue in IP-Based URL as well.

Hi..tis worked with below code
Map<String, Object> prefs = new HashMap<String, Object>()
prefs.put(“download.default_directory”, downloadFilePath)
//automatic download
prefs.put(“download.prompt_for_download”, false)
prefs.put(“download.directory_upgrade”, true)
prefs.put(“safebrowsing.enabled”, true)
prefs.put(“profile.default_content_setting_values.automatic_downloads”, 1)
if (driverType==‘HEADLESS_DRIVER’) {
List headlessArgs = [
“–window-size=1366,768”,
“–unsafely-treat-insecure-origin-as-secure=” + environment
]
RunConfiguration.setWebDriverPreferencesProperty(‘args’, headlessArgs)
RunConfiguration.setWebDriverPreferencesProperty(‘prefs’, prefs)
}