问题描述
我正在尝试连接到本地主机上使用 SSL 的应用程序.我正在使用 Mac OS X Mavericks.我得到的错误如下:
I am trying to connect to application on localhost which uses SSL. I am using Mac OS X Mavericks. The error I am getting is following:
Error sending cURL get request to https://dev.site.com:5555/version
Error code: 60 Error msg: SSL certificate problem: Invalid certificate chain
我尝试将证书添加到链中:
I tried to add certificates to the chain:
/usr/bin/security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" /etc/path/ca_key.pem
仍然遇到同样的错误.
推荐答案
--cacert
和 --cert
在 OSX Mavericks 中被破坏.
--cacert
and --cert
are broken in OSX Mavericks.
您可以在此处阅读更多信息:https://groups.google.com/forum/#!topic/munki-dev/oX2xUnoQEi4
You can read more about it here: https://groups.google.com/forum/#!topic/munki-dev/oX2xUnoQEi4
解决方法在这里:http://curl.haxx.se/mail/archive-2013-10/0036.html 表示需要将证书导入为可信系统证书:
The workaround is here: http://curl.haxx.se/mail/archive-2013-10/0036.html which indicates that you need to import the certificate as a trusted system cert:
使用 Keychain Access 将证书导入系统(系统")或用户(登录")钥匙串,并将其标记为对于 SSL 和 X.509 基本策略始终受信任.
这篇关于SSL 证书 - OS X Mavericks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!