Added option to set certificate