How do I get SSL working in fsockopen?

后端 未结 1 1392
我寻月下人不归
我寻月下人不归 2021-01-01 12:48

I\'m running PHP 5.2.6 on Windows, I have extension=php_curl.dll and extension=php_openssl.dll uncommented in php.ini; as such I can see the follow

相关标签:
1条回答
  • 2021-01-01 13:43

    This may sound obvious, but have you tried this instead?

    if ($fp = fsockopen('ssl://'. $host, 443, $errno, $errstr, 30)) {
    

    I'm not sure if the // is required or not, but the ssl and tls examples on the PHP Internet Transports page have them.

    P.S. I also have a "thing" about included variables in strings, in case you're wondering why it uses string concatenation now.

    0 讨论(0)
提交回复
热议问题