added option to enforce ssl