Failed to load URL https://localhost/ with error Certificate (-202).

I have project to make serious game about phishing attacks.
There is a Java-based project that opens a web page in Localhost and works well on the regular browser.
When I try to open the page in the Unreal Engine, this error appears

with https → “Failed to load URL https://localhost/ with error Certificate (-202).”

with http → “Failed to load URL http://localhost/ with error ERR_CONNECTION_REFUSED (-102).”

Although it opens unsafe url from the Internet, but it shows me this error when I run the Java project
and I also added self-signed certificate, and also I tried to run the server in other computer in the network and open it by ip but get the same results ( works on normal web broswer but not in the unreal broswer)

link to github of java project: