What potential issues can arise when making SOAP requests in PHP to websites with SSL certificates and SNI enabled?
When making SOAP requests in PHP to websites with SSL certificates and SNI enabled, you may encounter issues with the SSL handshake failing due to the Server Name Indication (SNI) not being properly set in the request. To solve this issue, you need to explicitly set the "SNI_server_name" option in the stream context used for the SOAP request.
$options = array(
'ssl' => array(
'SNI_server_name' => 'example.com'
)
);
$context = stream_context_create($options);
$client = new SoapClient('https://example.com/soap/wsdl', array('stream_context' => $context));