fix ssl and add security