# File lib/rhc/commands/alias.rb, line 67
    def update_cert(app, app_alias)
      certificate_file_path = options.certificate
      raise ArgumentError, "Certificate file not found: #{certificate_file_path}" if !File.exist?(certificate_file_path) || !File.file?(certificate_file_path)

      private_key_file_path = options.private_key
      raise ArgumentError, "Private key file not found: #{private_key_file_path}" if !File.exist?(private_key_file_path) || !File.file?(private_key_file_path)

      certificate_content = File.read(certificate_file_path)
      raise ArgumentError, "Invalid certificate file: #{certificate_file_path} is empty" if certificate_content.to_s.strip.length == 0

      private_key_content = File.read(private_key_file_path)
      raise ArgumentError, "Invalid private key file: #{private_key_file_path} is empty" if private_key_content.to_s.strip.length == 0

      rest_app = rest_client.find_application(options.namespace, app)
      rest_alias = rest_app.find_alias(app_alias)
      if rest_client.api_version_negotiated >= 1.4
        rest_alias.add_certificate(certificate_content, private_key_content, options.passphrase)
        success "SSL certificate successfully added."
        0
      else
        raise RHC::Rest::SslCertificatesNotSupported, "The server does not support SSL certificates for custom aliases."
      end
    end