今天用QtSoap测试一个web service的例子时,在应用程序输出窗口输出大量警告如下:
Warning: QSslSocket: cannot resolve SSL_set_psk_client_callback
Warning: QSslSocket: cannot resolve TLSv1_1_client_method
Warning: QSslSocket: cannot resolve TLSv1_2_client_method
Warning: QSslSocket: cannot resolve TLSv1_1_server_method
Warning: QSslSocket: cannot resolve TLSv1_2_server_method
网上搜索答案,确认是因为openssl版本过低的原因。
用命令查看openssl版本:openssl version
果然只有0.9.8,而最新的版本已经到1.0.2,升级步骤如下:
1. 执行which openssl,查看现有的openssl安装位置,比如/usr/bin/openssl;
2. 通过homebrew安装最新的openssl:
brew update
brew install openssl
brew link --force openssl
3. 备份原来的,然后用新的链接指向它:
mv /usr/bin/openssl /usr/bin/openssl_OLD
ln -s /usr/local/Cellar/openssl/1.0.1g/bin/openssl /usr/bin/openssl