When my simple HTTPS server implemented using com.sun.net.httpserver.HttpServer is called via this PHP proxy (which uses curl), it works fine. But as soon as I don't use the proxy but change my web form so that browsers directly send their requests to the server, the server becomes unstable and sometimes stops responding. The client will then wait for a response until it times out. The problem is difficult to reproduce and sometimes happens after hours in the live system. All of this is via HTTPS, on a non-standard port (currently 8081). My server returns XML.
The stacktrace I see when the server doesn't respond anymore (via "kill -QUIT [pid]"):