I want to chime in since I have a QEMU environment where I have to download files in java. It turns out the /etc/ssl/certs/java/cacerts
in QEMU does have problem because it does not match the /etc/ssl/certs/java/cacerts
in the host environment. The host environment is behind a company proxy so the java cacerts is a customized version.
If you are using a QEMU environment, make sure the host system can access files first. For example you can try this script on your host machine first to see. If the script runs just fine in host machine but not in QEMU, then you are having the same problem as me.
To solve this issue, I had to make a backup of the original file in QEMU, copy over the file in host environment to the QEMU chroot jail, and then java could download files normally in QEMU.
A better solution would be mount the /etc
into the QEMU environment; however I am not sure if other files will get impacted in this process. So I decided to use this ugly but easy work-around.