【问题标题】:Compiling OpenSSL on windows 8 metro在 Windows 8 Metro 上编译 OpenSSL
【发布时间】:2012-07-18 08:32:58
【问题描述】:

我必须将 OpenSSL 移植到 winRT(x86 而非 ARM 上的 windows 8 metro),所以我计划从编译 WinRt 开始。 我已经从http://www.openssl.org/source/下载了源代码

在源代码中,我看到了一些特定于操作系统的文件夹,例如 MacOS、OS2,还有 ms 文件夹,但我没有看到任何 Visual Studio 项目。到目前为止我所读到的关于编译 OpesSSL 的任何内容都谈到了 makefile 和 mingw,但我对 makefile 不太满意,而且不确定 Windows 8 是否支持 cygwin 和 perl。所以我正在寻找一些关于如何编译 OpenSSL 的想法在 Windows 8 上使用 Visual Studio。请分享您的知识或指出可以帮助我做到这一点的方向。非常感谢

【问题讨论】:

  • 借助 Visual Studio 2013 Update 3,Microsoft 为 Windows Phone 和 Windows Store 应用程序启用了 WinSock 和 OpenSSL。您可以使用 WinSock API 和许多流行的 OSS 库,例如 OpenSSL 更多关于它的信息在这里 - blogs.windows.com/buildingapps/2014/10/13/…

标签: windows windows-8 windows-runtime


【解决方案1】:

metro 风格的 SSL 加密解决方案效果很好。但是,如果您没有连接到 Web 服务,则存在一些缺点:
- 您无法控制 SSL 握手的参数(如密码、服务器证书验证)
- 无法出示用户证书以向服务器验证客户端
- 依赖微软升级 SSL 堆栈新加密等。

有些人致力于将 openssl 移植到 Windows 运行时。看 http://openssl.6102.n7.nabble.com/winrt-random-td42100.html
就是说只配置和构建openssl,不支持winsock(只有内存BIO),替换一些不支持的功能。

因此可以做到这一点,但与内置解决方案相比,尚不支持开箱即用。但是如果你想移植一些已经使用 openssl 的软件,这可能是一个解决方案。

【讨论】:

    【解决方案2】:

    OpenSSL 将在 Windows 8 下构建,仅用于桌面模式。 Metro/WinRT 不再提供 Winsock(或 API 兼容的替代方案),因此您将无法直接针对 WinRT 进行编译。

    【讨论】:

    • 是的,因为没有你提到的winsock,我将无法直接编译,我将不得不找到winsock的替代品..可能是使用streamsocket。我更感兴趣的是知道要在 Visual Studio 项目中包含哪些文件。如果我阅读 makefile nt32dll.mak 有很多文件,我真的需要包括所有这些吗?
    • 借助 Visual Studio 2013 Update 3,Microsoft 为 Windows Phone 和 Windows Store 应用程序启用了 WinSock 和 OpenSSL。您可以使用 WinSock API,因此可以使用许多流行的 OSS 库,例如 libcURL、libwebsockets、OpenSSL 等。更多信息请点击此处 - blogs.windows.com/buildingapps/2014/10/13/…
    【解决方案3】:

    为什么要在 WinRT 中使用 OpenSSL?

    如果您仅出于安全目的使用它,则可以省略它 inmetro 风格的 WinRT。因为 WinRT 本身为 Metro 风格的套接字编程提供了安全性,例如

    //0: A plain socket with no encryption.
    socket->ConnectAsync(hostname, serviceName, SocketProtectionLevel::PlainSocket);
    
    //1: A socket that must use the SSL for encryption. This value requires encryption and never allows a NULL cipher.
    socket->ConnectAsync(hostname, serviceName, SocketProtectionLevel::Ssl);
    
    //2: A socket that prefers to use the SSL for encryption. This value prefers that full encryption be used, but allows a NULL cipher (no encryption) based on the server configuration.
    socket->ConnectAsync(hostname, serviceName, SocketProtectionLevel::SslAllowNullEncryption);
    

    【讨论】:

    • 非常感谢你有趣的观点,我必须使用 openssl,因为我正在将现有的 Windows 库移植到 WinRT。 openssl 用于证书存储和处理。
    猜你喜欢
    • 2017-02-21
    • 2011-03-15
    • 1970-01-01
    • 1970-01-01
    • 2019-03-26
    • 2015-04-10
    • 2021-01-21
    • 2014-10-08
    • 2011-02-14
    相关资源
    最近更新 更多