How do I get SSL working in fsockopen?

喜欢而已 提交于 2019-11-30 11:08:13
Powerlord

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!