当我运行php测试脚本尝试使用curl和我的Macports php安装通过https连接到Rackspace API时,我收到unsupported protocol
错误(curl verbose设置为true)。见下文:
AndyMac:test Andy$ which php
/opt/local/bin/php
AndyMac:test Andy$ php test.php
* About to connect() to lon.auth.api.rackspacecloud.com port 443 (#0)
* Trying 212.64.148.13...
* connected
* Connected to lon.auth.api.rackspacecloud.com (212.64.148.13) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /opt/local/share/curl/curl-ca-bundle.crt
CApath: none
* error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol
* Closing connection #0
AndyMac:test Andy$
AndyMac:test Andy$ php -i | grep -i ssl
/opt/local/var/db/php5/openssl.ini,
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
SSL => Yes
SSL Version => OpenSSL/1.0.1
SSL => supported
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.1 14 Mar 2012
OpenSSL Header Version => OpenSSL 1.0.0d 8 Feb 2011
OpenSSL support => enabled
AndyMac:test Andy$
正如你所看到的,PHP是用ssl支持编译的。如果我在我的Mac上使用默认安装的php运行测试脚本,那么它可以运行,因此php Macports安装似乎有问题。此外,似乎我得到其他https网址使用curl与Macports PHP安装我能够得到一个响应。
有什么建议吗?