Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions lib/Transip/Api/SoapClientAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ protected function soapClient(array $classMap, $parameters = array())
'trace' => false, // can be used for debugging
);

$options = array_merge($options, $this->client->getSoapOptions());

$streamOptions = array(
'ssl' => array(
'SNI_enabled' => true,
'SNI_server_name' => $endpoint,
'peer_name' => $endpoint,
)
);
$streamContext = stream_context_create($streamOptions);
$options['stream_context'] = $streamContext;

$wsdlUri = "https://{$endpoint}/wsdl/?service=" . $this->service;
try {
$this->soapClient = new \SoapClient($wsdlUri, $options);
Expand Down
21 changes: 21 additions & 0 deletions lib/Transip/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class Client
*/
protected $privateKey;

/**
* Option to add aditional options to the SoapClient(http://php.net/manual/en/soapclient.soapclient.php)
*/
protected $soapOptions = array();

/**
* @param string $login
* @param string $privateKey
Expand Down Expand Up @@ -151,4 +156,20 @@ public function setMode($mode)

throw new \Exception("$mode is not a available mode for this API.");
}

/**
* @return array
*/
public function getSoapOptions()
{
return $this->soapOptions;
}

/**
* @param array $soapOptions
*/
public function setSoapOptions($soapOptions)
{
$this->soapOptions = $soapOptions;
}
}