[fix] Implemented replacement of http protocol if current connection is https. Fixes #994