Fix for webui becoming unresponsive when using SSL and possibly in other situations as well.