Windows under OpenSSL installation process

Source: Internet
Author: User

Environment Preparation:

1. Perlhttp://downloads.activestate.com/activeperl/releases/5.16.3.1603/activeperl-5.16.3.1603-mswin32-x86-296746.zip

2. OpenSSL http://www.openssl.org/source/download latest OpenSSL and unzip to C:\openssl-1.0.1e.

Installation steps: (Note: Install.win32 installation instructions in the OpenSSL directory)

1, running configure.

>CD C:\openssl-1.0.1e

>perl Configure vc-win32--prefix=c:/openssl Specify the installation directory here

2. Create a makefile file.

>ms\do_ms

It is recommended to use this method, and the other two methods must be used to ensure that the machine has a compiler to use.

: Ms\do_masm (Default VC comes with the compiler; also download and install it yourself)

: ms\do_nasm (download required)

3, configure the VC environment variable.

>CD C:\Program Files\Microsoft Visual Studio\vc98\bin

>vcvars32.bat

4, compile.

>CD C:\openssl-1.0.1e

>nmake-f Ms\ntdll.mak

If the compilation succeeds, the final output is in the Out32dll directory: executable files, two DLLs (Ssleay32.dll, Libeay32.dll), and two export library files (ssleay32.lib, libeay32.lib).

Compile in two cases to generate static and dynamic libraries
(1) If you are compiling the OpenSSL dynamic library, type nmake-f ms\ntdll.mak at the command line
Compile successfully can view the output file in the folder Out32dll, including the application EXE file, lib file, dll file.
(2) If you are compiling the OpenSSL static library, type Nmake-f ms\nt.mak at the command line
Compile successfully can view the output file in the folder Out32, including the application EXE file, lib file.
To this compilation has been completed.

There are several other commands that may be used:

Testing the OpenSSL dynamic library: nmake-f Ms\ntdll.mak test
Test OpenSSL Static Library: nmake-f Ms\nt.mak test
Installing the OpenSSL dynamic Library: nmake-f Ms\ntdll.mak Install
Installing the OpenSSL static Library: nmake-f Ms\nt.mak Install
Clears the compilation of the last OpenSSL dynamic library for recompilation: nmake-f ms\ntdll.mak Clean
Clears the compilation of the last OpenSSL static library for recompilation: nmake-f ms\nt.mak Clean

5, check whether the success, the execution of the command: "Nmake-f ms\ntdll.mak test".


6, run "nmake-f ms\ntdll.mak Install", or "nmake-f Ms\nt.mak Install" installs the compiled OpenSSL to the specified directory.


7, see the installation Results C:\Openssl contains three folders bin, include, Lib. The bin includes openssl.exe (OpenSSL instruction program), Ssleay32.dll (SSL protocol Dynamic Library), Libeay32.dll (cipher algorithm library). Lib includes the Libeay32.lib,ssleay32.lib. The Include directory includes the header files of the OpenSSL development design.

8. Add header file and static link library path for VC.

Add the C:\Openssl\include directory to the Include files;

Add C:\openssl-1.0.1e\out32dll to Libray files.

9, write the OpenSSL program, can refer to C:\openssl-1.0.1e\demos

(1) include the corresponding header file

#include <openssl/ssl.h>

#include <openssl/err.h>

#include <openssl/bio.h>

(2) Add a static link library

#pragma comment (lib, "Libeay32.lib")

#pragma comment (lib, "Ssleay32.lib")

or Projectàsettingsàlinkàobject\library modules fill out libeay32.lib ssleay32.lib.

(3) Copy the dynamic link library Ssleay32.dll, libeay32.dll to the C:\WINDOWS\system32 or debug directory, and ensure that the dynamic link library is in the correct path.

Problems encountered during installation:

Nmake-f Ms\ntdll.mak times the following error:
1. Building OpenSSL
Perl util/copy.pl ". \.\e_os.h" "Tmp32dll\e_os.h"
Can ' t load ' e:\oraclepro\perl\5.8.3\lib/mswin32-x86-multi-thread/auto/fcntl/fcnt
L.dll ' for module Fcntl:load_file: The specified module could not be found. At E:\OraclePro\perl\5.8.3
\LIB/MSWIN32-X86-MULTI-THREAD/XSLOADER.PM Line 68.
At E:\ORACLEPRO\PERL\5.8.3\LIB/MSWIN32-X86-MULTI-THREAD/FCNTL.PM Line 234
Compilation failed in require for util/copy.pl line 3.
BEGIN failed--compilation aborted at util/copy.pl Line 3.
Nmake:fatal error U1077: "C:\Perl\bin\perl. EXE ": Return code" 0xFF "
Stop.

2, or Perl.exe pop-up prompt Box said: Perl58.dll not found

View the environment variable perl5lib instead, clear all environment variables inside the directory except Perl.
I am here only "C:\PERL\LIB\AUTO\FCNTL;" The value of this value in path contains c:\perl\bin:c;\perl\site\bin; C:\Perl\bin;

Another try not to use vc++6.0 to compile on the Win7 may be in the link when the error, verified with vs2010 Chinese version no problem

Windows under OpenSSL installation process

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.