【C++】已编译好的OpenSSL Windows版分享网站

http://slproweb.com/products/Win32OpenSSL.html

(文章末尾附下载列表)

说明:

例如:Win32 OpenSSL v1.1.1c -- 02.Win32OpenSSL-1_1_1c.exe安装后目录如下

基于此安装可以进行OpenSSL的二次开发,bin/lib/include开发所需的文件都在这个里面。比如使用此安装可以用于编译libcurl库。

OpenSSL在Windows下的编译真的非常麻烦,如果加上支持zlib就更麻烦(此网站的安装包都不支持zlib)。有编译好的OpenSSL Windows版真的会降低编译门槛和时间!

唯一不足的是没有支持zlib模块。查看安装包下的OpenSSL支持的模块,截图如下:

我编译的"OpenSSL 1.1.1c Win32 zlib MD(多线程)版"模块支持情况如下: 相比上图底部多了zlib支持

 

下载列表:

说明:因为OpenSSL在当前(2019.06.25)时间在维护的主版本有1.1.1c、1.1.0k、1.0.2s,因此此网站也仅提供了这几个版本。可以查看OpenSSL官网版本发布策略

我的百度网盘备份分享:链接:https://pan.baidu.com/s/1B_jI99kIFKVLS_NwX8Vvsw  提取码:0rob 

Download Win32/Win64 OpenSSL today using the links below!
 
FileTypeDescription
Win64 OpenSSL v1.1.1c Light
EXE | MSI (experimental)
3MB InstallerInstalls the most commonly used essentials of Win64 OpenSSL v1.1.1c (Recommended for users by the creators of OpenSSL). Only installs on 64-bit versions of Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win64 OpenSSL v1.1.1c
EXE | MSI (experimental)
43MB InstallerInstalls Win64 OpenSSL v1.1.1c (Recommended for software developers by the creators of OpenSSL). Only installs on 64-bit versions of Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win32 OpenSSL v1.1.1c Light
EXE | MSI (experimental)
3MB InstallerInstalls the most commonly used essentials of Win32 OpenSSL v1.1.1c (Only install this if you need 32-bit OpenSSL for Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win32 OpenSSL v1.1.1c
EXE | MSI (experimental)
30MB InstallerInstalls Win32 OpenSSL v1.1.1c (Only install this if you need 32-bit OpenSSL for Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win64 OpenSSL v1.1.0k Light3MB InstallerInstalls the most commonly used essentials of Win64 OpenSSL v1.1.0k (Recommended for users by the creators of OpenSSL). Only installs on 64-bit versions of Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win64 OpenSSL v1.1.0k37MB InstallerInstalls Win64 OpenSSL v1.1.0k (Recommended for software developers by the creators of OpenSSL). Only installs on 64-bit versions of Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win32 OpenSSL v1.1.0k Light3MB InstallerInstalls the most commonly used essentials of Win32 OpenSSL v1.1.0k (Only install this if you need 32-bit OpenSSL for Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win32 OpenSSL v1.1.0k30MB InstallerInstalls Win32 OpenSSL v1.1.0k (Only install this if you are a software developer needing 32-bit OpenSSL for Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win64 OpenSSL v1.0.2s Light3MB InstallerInstalls the most commonly used essentials of Win64 OpenSSL v1.0.2s (Recommended for users by the creators of OpenSSL). Only installs on 64-bit versions of Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win64 OpenSSL v1.0.2s23MB InstallerInstalls Win64 OpenSSL v1.0.2s (Recommended for software developers by the creators of OpenSSL). Only installs on 64-bit versions of Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win32 OpenSSL v1.0.2s Light2MB InstallerInstalls the most commonly used essentials of Win32 OpenSSL v1.0.2s (Only install this if you need 32-bit OpenSSL for Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
Win32 OpenSSL v1.0.2s20MB InstallerInstalls Win32 OpenSSL v1.0.2s (Only install this if you are a software developer needing 32-bit OpenSSL for Windows. Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以直接用别人做好的windows OpenSSL 安装包(我用的是0.9.8j), 可以从 http://www.slproweb.com/products/Win32OpenSSL.html 下载 OpenSSL for Windows,直接安装。 P.S. OpenSSL for Windows 的源代码有一些数据类型和VC6的编译器不兼容,我发现的不兼容的数据类型如下:   在OpenSSL安装目录的下的include/bn.h文件中,将 #define BN_ULLONG unsigned long long #define BN_ULONG unsigned long long #define BN_LONG long long 分别修改为: #define BN_ULLONG ULONGLONG #define BN_ULONG ULONGLONG #define BN_LONG LONGLONG 否则,会出现编译错误。 二、使用OpenSSL 在VC中配置使用以上的函数库: 点击菜单:Tools -> Options,弹出对话框"Options",在该对话框中选择"Directories"标签。 在"Show directories for:"的"Include files"选项中新增目录"C:\openssl\include"; "Library files"选择中新增目录"C:\openssl\lib"。 然后在需要链接OpenSSL函数库的工程中加入如下两句: #pragma comment(lib, "ssleay32.lib") #pragma comment(lib, "libeay32.lib") 其作用是将OpenSSL所需的库导入工程中。 三、问题 我在链接OpenSSL的静态函数库时遇到类似以下的问题: Linking... msvcrt.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in libcmtd.lib(strchr.obj) ... 这是由于OpenSSL的静态函数库使用的是了VC的多线程DLL的Release本,而我的程序使用了多线程静态链接的Release本。 调整OpenSSL的静态函数库使用的库函数本即可,调整过程如下: 编辑文件 ms\nt.mak,将该文件第19行 "CFLAG= /MD /Ox /O2 /Ob2 /W3 /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE - D_CRT_NONSTDC_NO_DEPRECATE /Fdout32 -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_TLSEXT -DOPENSSL_NO_KRB5 - DOPENSSL_NO_DYNAMIC_ENGINE" 中的"/MD"修改为"/MT"。然后重新编译安装OpenSSL即可。 四、附录:在VC中对C/C++ 运行时库不同编译指令说明 《在VC中对C/C++ 运行时库不同编译指令说明》(http://blog.yesky.com/271/dgkang/1737771.shtml)一文中详细介绍了连接不同本库的编译指令如下: C Runtime Library: /MD MSVCRT.LIB 多线程DLL的Release本 /MDd MSVCRTD.LIB 多线程DLL的Debug本 /MT LIBCMT.LIB 多线程静态链接的Release本 /MTd LIBCMTD.LIB 多线程静态链接的Debug本 /clr MSVCMRT.LIB 托管代码和非托管代码混合 /clr:pure MSVCURT.LIB 纯托管代码 C++ Standard Library: /MD MSVCPRT.LIB 多线程DLL的Release本 /MDd MSVCPRTD.LIB 多线程DLL的Debug本 /MT LIBCPMT.LIB 多线程静态链接的Release本 /MTd LIBCPMTD.LIB 多线程静态链接的Debug
Windows 上使用 C++ 引入 OpenSSL 可以按照以下步骤进行: 1. 下载 OpenSSL 库 在 OpenSSL 官网的下载页面(https://www.openssl.org/source/)上,选择一个合适的本下载,推荐下载最新的稳定本(例如 OpenSSL 1.1.1)。 2. 安装 OpenSSL 库 将下载的 OpenSSL 压缩包解压到某个目录下,例如 `C:\OpenSSL`。 3. 配置 Visual Studio 打开 Visual Studio,创建一个新的 C++ 项目。在项目属性中进行如下配置: * 将 `C/C++` -> `常规` -> `附加包含目录` 添加 `C:\OpenSSL\include`。 * 将 `链接器` -> `常规` -> `附加库目录` 添加 `C:\OpenSSL\lib`。 * 将 `链接器` -> `输入` -> `附加依赖项` 添加 `libssl.lib;libcrypto.lib`。 4. 使用 OpenSSL 库 在 C++ 代码中引入 OpenSSL 库的头文件,并使用 OpenSSL 库的函数进行编程,例如: ```c++ #include <openssl/bio.h> #include <openssl/evp.h> #include <openssl/buffer.h> // 在这里使用 OpenSSL 库的函数 ``` 在编译时,需要将 OpenSSL 库的 DLL 文件(`libssl-1_1-x64.dll` 和 `libcrypto-1_1-x64.dll`)拷贝到生成的可执行文件所在的目录下。在 Visual Studio 中,可以将这两个 DLL 文件添加到项目中,并设置为“始终复制”属性,以确保它们被正确地复制到输出目录中。 注意:如果您使用的是静态链接库(.lib 文件),则不需要将 DLL 文件拷贝到输出目录中。 希望这些步骤可以帮助您在 Windows 上使用 C++ 引入 OpenSSL 库。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值