'PHP SoapClient - Can't get to connect to SSL

I have soap requests being sent via PHP SoapClient - but no matter what I do I can't get the requests to send via SSL / port 443.

Our servers have valid SSL, the receiving party has SSL, I'm using a URL that is https://, but the data is still being sent via port 80 (proven by netstat on my side and logging on the receiving party side).

I've tried many configurations of soap client options, but it is still connecting through port 80. I am in desperate need of getting this fixed, any help would be appreciated.

My current/latest attempts are using these options:

$soapClient = new SoapClient($url, [
            'soap_version' => SOAP_1_1,
            'trace' => 1,
            'exceptions' => true,
            'encoding' => 'UTF-8',
            'keep_alive' => false,
            'stream_context' => stream_context_create([
                'ssl' => [
                    'crypto_method' =>  STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
                ]
            ])
]);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source