Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ public function setupAuth($user, $pass, $auth = 'basic')
$this->curl_opts[CURLOPT_HTTPAUTH] = constant('CURLAUTH_' . strtoupper($auth));
$this->curl_opts[CURLOPT_USERPWD] = $user . ":" . $pass;
}

/**
* Setup client certificate
*
* @param string $certificateFile
* @param string $privateKeyFile
* @param string $privateKeyPassword Optional
*/
public function setupClientCertificate($certificateFile, $privateKeyFile, $privateKeyPassword = null)
{
$this->curl_opts[CURLOPT_SSLCERT] = $certificateFile;
$this->curl_opts[CURLOPT_SSLKEY] = $privateKeyFile;
if(is_string($privateKeyPassword) && strlen($privateKeyPassword) > 0)
{
$this->curl_opts[CURLOPT_SSLKEYPASSWD] = $privateKeyPassword;
}
}

/**
* Set cookies for this session
Expand Down