macos OpenSSL 安装问题到 MAC
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9874728/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
OpenSSL install issue to MAC
提问by hiwordls
I tried to install openSSL to my MAC but I did not. I watched the steps below, but I could not understand exactly what you should do. I am a new mac user. Please tell us about what to do as a simple
我尝试将 openSSL 安装到我的 MAC,但我没有。我看了下面的步骤,但我不明白你应该做什么。我是 mac 新用户。请告诉我们如何做一个简单的
Step 1) Download OpenSSL 0.9.6c here: http://www.openssl.org/source/openssl-0.9.6c.tar.gz
步骤 1)在此处下载 OpenSSL 0.9.6c:http: //www.openssl.org/source/openssl-0.9.6c.tar.gz
Step 2) Uncompress the archive and rename the resulting folder "openssl"
步骤 2) 解压缩存档并将生成的文件夹重命名为“openssl”
step 3) Open up the terminal and type cd /users/YOURUSERNAME/desktop/
步骤 3) 打开终端并输入 cd /users/YOURUSERNAME/desktop/
step 4) type sudo mv openssh /usr/local/
步骤 4) 输入 sudo mv openssh /usr/local/
step 5) type sudo cd /usr/local/openssl
步骤 5) 输入 sudo cd /usr/local/openssl
step 6) type ./config
步骤 6) 输入 ./config
step 7) type make
步骤 7)输入 make
step 8) type make install
步骤 8) 输入 make install
回答by jww
Download OpenSSL 0.9.6c here
在此处下载 OpenSSL 0.9.6c
Man, 0.9.6 is old. Are you sure you want/need it?
伙计,0.9.6 太旧了。你确定你想要/需要它吗?
Here's the recipe using OpenSSL 1.0.1f:
这是使用 OpenSSL 1.0.1f 的秘诀:
$ wget http://www.openssl.org/source/openssl-1.0.1f.tar.gz
$ tar xzf openssl-1.0.1f.tar.gz
$ cd openssl-1.0.1f
$ ./Configure darwin64-x86_64-cc
$ make all
$ sudo make install
If you are on an old 32-bit Mac, then use ./Configure darwin-i386-cc
.
如果您使用的是旧的 32 位 Mac,请使用./Configure darwin-i386-cc
.
There's no need to build in /usr/local
using sudo
. In fact, its preferred to compile under an unprivileged account and only elevate during install.
无需内置/usr/local
使用sudo
. 事实上,它更喜欢在非特权帐户下编译,并且只在安装过程中提升。
OpenSSL comes with 0.9.8. To ensure you use the copy of OpenSSL you just downloaded, built and installed:
OpenSSL 附带 0.9.8。为确保您使用刚刚下载、构建和安装的 OpenSSL 副本:
gcc -I/usr/local/ssl/include <your source files> -o <your prog name> -L/usr/local/ssl/lib -lssl -lcrypto -lpthread -ldl
The trick is that OpenSSL installs into /usr/local/ssl
. So you find headers in /usr/local/ssl/include
and libraries in /usr/local/ssl/lib
.
诀窍是 OpenSSL 安装到/usr/local/ssl
. 因此,您可以/usr/local/ssl/include
在/usr/local/ssl/lib
.