Write certificate on read instead of write.

[#81019816]

OG PR here: #233 for more information
this is kinda weird. I wonder if we should pass cert_file into the remote_deployment_model since it should really only be used there?