【发布时间】:2014-01-30 22:10:55
【问题描述】:
所以我正在向一个网址(https:// 地址)发出获取请求,我只想从中接收一小段文本。这在 localhost 上运行良好,但是当我在我的网络服务器(由 one.com 托管)上执行此操作时,它不起作用。它显示了这个错误:
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112) in
/customers/0/4/f/mydomain.se/httpd.www/test.php on line 4 Warning:
file_get_contents(): Failed to enable crypto in
/customers/0/4/f/mydomain.se/httpd.www/test.php on line 4 Warning:
file_get_contents(https://dogeapi.com/wow/?
api_key={my apikey}&a=get_new_address&address_label=46): failed to open
stream: operation failed in /customers/0/4/f/mydomain.se/httpd.www/test.php on line 4
我可以从网络服务器发出其他的获取请求,但不是这个特定的请求。可能是什么原因?
【问题讨论】:
-
很可能是一些损坏的 ssl 库?你能在命令行那里
wgeturl吗? -
file_get_contents() 不应该用于 https 连接使用 curl