title: Mojo::UserAgent TLS/SSL certificate authentication
body: <p>I am new to Mojolicious and I am trying to get a Mojo::UserAgent script to use both a TLS certificate authority and a TLS certificate file but certificate file is password protected. I am having issues passing the password so the client certificate can be opened.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>
  #!/usr/bin/env perl
  
  use Modern::Perl;
  use Mojo::UserAgent;
  
  IO::Socket::SSL::set_defaults(SSL_passwd_cb => sub {return "password";});
  my $ua = Mojo::UserAgent->new;
  my $base_dir = '/path/to/certs/';
  $ua->ca($base_dir . 'ca-cert.crt');
  $ua->cert($base_dir . 'clientcert.crt');
  my $tx = $ua->build_tx(POST => '/POST HTTP/1.1');
  $tx->req->url->parse('https://example.com:12345');
  $ua->start($tx);
  
  if(my $res = $tx->success) {
    say $res->body;
    print Dumper($tx);
  } else {
    my ($err, $code) = $tx->error;
    say $code ? "$code response: $err" : "Connection error: $err";
  }
  </code></pre>
  
  <p>I have verified the certificate with the following:</p>
  
  <p><code>openssl s_client -connect host:port -CApath /path/to/cert - CAfile ca-cert.crt -cert clientcert.crt</code></p>
  
  <p>I get prompted with:</p>
  
  <p><code>Enter pass phrase for clientcert.crt:</code></p>
  
  <p>I enter the password and it authenticates correctly.</p>
  
  <p>So, how do I get the password to IO::Socket::SSL?</p>