Moved ssl cert creation to nearly the end. 

Interaction at beginning and end of script only.