Kong / unirest-php

Unirest in PHP: Simplified, lightweight HTTP client library.
http://unirest.io/php
MIT License
1.28k stars 328 forks source link

Request support for client side SSL certificates #116

Open rob-watts2 opened 8 years ago

rob-watts2 commented 8 years ago

I am requesting support for client side SSL support.

Consider this code in PHP/cURL fragment:

    curl_setopt($curl, CURLOPT_CAINFO, 'someCertificateCA.pem'); 
    curl_setopt($curl, CURLOPT_SSLCERT, 'someClientSideSSLCertificate.pem');
    curl_setopt($curl, CURLOPT_SSLCERTPASSWD, "aPassw0rd");

There is no way to do this in the current version of UniRest for PHP that I'm aware of. Can it be added?

ahmadnassri commented 8 years ago

indeed, this is something important to add

serveba commented 7 years ago

is there some news about this issue?

miquelnez commented 7 years ago

This library... is a bit abandoned... but, if you review all the code, on Request.php you can find a static curlOpts to any CURL param:

\Unirest\Request::curlOpts(array( CURLOPT_SSLKEY => $this->keyPath, CURLOPT_CAINFO => $this->caPath, CURLOPT_SSLCERT => $this->certPath ));

here is the curl_setopt options: http://us2.php.net/manual/es/function.curl-setopt.php

rob-watts commented 7 years ago

So is Unirest for PHP not being maintained? I like this library way better than Gulp..

I was thinking of trying to patch this up.

If you set auth like this:

// basic auth
Unirest\Request::auth('username', 'password');

Could we not do something like

Unirest\Request::certificate('certificatePath', 'password');