The following code returns false on some https urls, but it works fine using http urls. The url https://www.google.com/
will return true, while the url used in the code for example will return false.
PHP configuration:
- openssl enabled: yes
- http wrapper: yes
- https wrapper: yes
PHP code:
$proxySettings = array(
"http" => array(
"proxy" => "tcp://example.proxy",
"request_fulluri" => TRUE,
"timeout" => 3.0,
"protocol_version" => 1.0
)
);
$context = stream_context_create($proxySettings);
$fp_ssl = fopen("https://any-sms.biz/", "r", FALSE, $context);
This is the error I get when using https urls that dont work.
Warning: fopen(https://any-sms.biz/): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
How can I use fopen on any https url? Where is my error?
Thank you