Skip to content

Commit

Permalink
support ssl_method option
Browse files Browse the repository at this point in the history
  • Loading branch information
aaharu committed Jan 30, 2016
1 parent 2382b98 commit e5f2b20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Documentation

### Aaharu\Soap\CurlSoapClient::CurlSoapClient

This class is extended [SoapClient](http://php.net/manual/class.soapclient.php).

```php
public CurlSoapClient::CurlSoapClient ( mixed $wsdl [, array $options ] )
```
Expand All @@ -37,6 +39,7 @@ public CurlSoapClient::CurlSoapClient ( mixed $wsdl [, array $options ] )
- proxy_login
- proxy_password
- authentication
- ssl_method

#### additional options

Expand All @@ -55,8 +58,6 @@ public CurlSoapClient::CurlSoapClient ( mixed $wsdl [, array $options ] )
- use `CurlSoapClient::___curlSetOpt` instead
- passphrase
- use `CurlSoapClient::___curlSetOpt` instead
- ssl_method
- use `CurlSoapClient::___curlSetOpt` instead


Contributing
Expand Down
13 changes: 13 additions & 0 deletions src/CurlSoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0
}
$this->___configHttpAuthentication();
$this->___configProxy();
if (isset($this->_ssl_method) && is_int($this->_ssl_method)) {
switch ($this->_ssl_method) {
case SOAP_SSL_METHOD_SSLv2:
curl_setopt($this->curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv2);
break;
case SOAP_SSL_METHOD_SSLv3:
curl_setopt($this->curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
break;
default:
curl_setopt($this->curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
break;
}
}

try {
$response = $this->___curlCall($location);
Expand Down

0 comments on commit e5f2b20

Please sign in to comment.