Openssl 3.0安装流程——Windows平台,VS2019,Strawberryperl

安装准备

  • Perl

    可以考虑从官网下载:http://strawberryperl.com/

    但是国内下载有个弊端,就是速率慢。我有下载好的,如果有需要的,可以发我私信,也或者发我邮箱[email protected]

  • VS2019

    https://visualstudio.microsoft.com/zh-hans/vs/

    下载Community版本就可以,免费使用。能够满足基本需要了

安装流程

  • Perl

    安装完成后,打开命令行输入 perl -v,若提示如下界面,则安装成功。

  • VS2019

    要使用管理员权限,打开x86 Native Tools Command Prompt for VS 2019(备注:当然了如果您安装64bit。则打开x86_x64…即可)

  • Openssl 配置

    1. 在刚刚打开的VS2019命令行工具中,先使用cd命令转到Openssl源码所在的根目录,随后输入如下命令,进行配置。
    2. 最后的参数,–prefix=(这里是你打算安装的实际路径)
    3. 配置成功,结果如图所示。
1
perl Configure VC-WIN32 no-asm --debug --prefix=D:\Lang\Openssl

Perl Configure

  • Openssl 编译
    1. 配置完成后,需要进行编译。顺序执行如下命令。(每一步都没问题的情况下,则继续执行命令)。相关步骤结果如下图所示。(安装完成的步骤就不截图了,因为在你指定的路径中能看到了)
1
2
3
nmake
nmake test
nmake install

nmake结果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
>> nmake test  我电脑上的测试如下 (抱歉,其中有一些skipped的内容,我还没有天理解具体是做什么用的)
        set SRCTOP=.
        set BLDTOP=.
        set PERL=D:\Lang\Strawberry\perl\bin\perl.exe
        set FIPSKEY=f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813
        "D:\Lang\Strawberry\perl\bin\perl.exe" ".\test\run_tests.pl"
01-test_abort.t .................... ok
01-test_sanity.t ................... ok
01-test_symbol_presence.t .......... ok
01-test_test.t ..................... ok
02-test_errstr.t ................... skipped: This is unsupported on MSYS/MinGW or MSWin32
02-test_internal_context.t ......... ok
02-test_internal_ctype.t ........... ok
02-test_internal_keymgmt.t ......... ok
02-test_internal_provider.t ........ ok
02-test_lhash.t .................... ok
02-test_ordinals.t ................. ok
02-test_sparse_array.t ............. ok
02-test_stack.t .................... ok
03-test_exdata.t ................... ok
03-test_fipsinstall.t .............. ok
03-test_internal_asn1.t ............ ok
03-test_internal_asn1_dsa.t ........ ok
03-test_internal_bn.t .............. skipped: This test is unsupported in a shared library build on Windows
03-test_internal_chacha.t .......... ok
03-test_internal_curve448.t ........ ok
03-test_internal_ec.t .............. ok
03-test_internal_ffc.t ............. ok
03-test_internal_mdc2.t ............ ok
03-test_internal_modes.t ........... ok
03-test_internal_namemap.t ......... ok
03-test_internal_poly1305.t ........ ok
03-test_internal_rsa_sp800_56b.t ... skipped: This test is unsupported in a shared library build on Windows
03-test_internal_siphash.t ......... ok
03-test_internal_sm2.t ............. ok
03-test_internal_sm4.t ............. ok
03-test_internal_ssl_cert_table.t .. ok
03-test_internal_x509.t ............ ok
03-test_params_api.t ............... ok
03-test_property.t ................. ok
03-test_ui.t ....................... ok
04-test_asn1_decode.t .............. ok
04-test_asn1_encode.t .............. ok
04-test_asn1_string_table.t ........ ok
04-test_bio_callback.t ............. ok
04-test_bioprint.t ................. ok
04-test_conf.t ..................... ok
04-test_encoder_decoder.t .......... ok
04-test_err.t ...................... ok
04-test_hexstring.t ................ ok
04-test_param_build.t .............. ok
04-test_params.t ................... ok
04-test_params_conversion.t ........ ok
04-test_pem.t ...................... ok
04-test_provider.t ................. ok
04-test_provider_fallback.t ........ ok
05-test_bf.t ....................... ok
05-test_cast.t ..................... ok
05-test_cmac.t ..................... ok
05-test_des.t ...................... ok
05-test_hmac.t ..................... ok
05-test_idea.t ..................... ok
05-test_rand.t ..................... ok
05-test_rc2.t ...................... ok
05-test_rc4.t ...................... ok
05-test_rc5.t ...................... skipped: rc5 is not supported by this OpenSSL build
06-test-rdrand.t ................... ok
10-test_bn.t ....................... ok
10-test_exp.t ...................... ok
15-test_dh.t ....................... ok
15-test_dsa.t ...................... ok
15-test_ec.t ....................... ok
15-test_ecdsa.t .................... ok
15-test_ecparam.t .................. ok
15-test_gendh.t .................... ok
15-test_gendsa.t ................... ok
15-test_genec.t .................... ok
15-test_genrsa.t ................... ok
15-test_mp_rsa.t ................... ok
15-test_out_option.t ............... ok
15-test_rsa.t ...................... ok
15-test_rsaoaep.t .................. ok
15-test_rsapss.t ................... ok
20-test_app.t ...................... ok
20-test_cli_fips.t ................. 12/?
Verified OK
D:\Lang\Strawberry\perl\bin\perl.exe ..\..\util\wrap.pl ..\..\apps\openssl.exe dgst -sha256 -verify DSA.nonfips.priv.pem -signature DSA.nonfips.sig ..\..\providers\fips.dll => 0
    not ok 13 - DSA: Verify something with a non-FIPS key (should fail) # TODO see issues #12626, #12627
20-test_cli_fips.t ................. ok    -------------------------------------
20-test_dgst.t ..................... ok
20-test_enc.t ...................... ok
20-test_enc_more.t ................. ok
20-test_kdf.t ...................... ok
20-test_mac.t ...................... ok
20-test_passwd.t ................... ok
20-test_pkeyutl.t .................. ok
20-test_rand_config.t .............. ok
25-test_crl.t ...................... ok
25-test_d2i.t ...................... ok
25-test_eai_data.t ................. ok
25-test_pkcs7.t .................... ok
25-test_req.t ...................... ok
25-test_rusext.t ................... ok
25-test_sid.t ...................... ok
25-test_verify.t ................... ok
25-test_verify_store.t ............. ok
25-test_x509.t ..................... ok
30-test_acvp.t ..................... ok
30-test_aesgcm.t ................... ok
30-test_afalg.t .................... skipped: test_afalg not supported for this build
30-test_defltfips.t ................ ok
30-test_engine.t ................... ok
30-test_evp.t ...................... ok
30-test_evp_extra.t ................ ok
30-test_evp_fetch_prov.t ........... ok
30-test_evp_kdf.t .................. ok
30-test_evp_libctx.t ............... ok
30-test_evp_pkey_dparam.t .......... ok
30-test_evp_pkey_provided.t ........ ok
30-test_pbelu.t .................... ok
30-test_pkey_meth.t ................ ok
30-test_pkey_meth_kdf.t ............ ok
30-test_provider_status.t .......... ok
40-test_rehash.t ................... skipped: test_rehash is not available on this platform
60-test_x509_check_cert_pkey.t ..... ok
60-test_x509_dup_cert.t ............ ok
60-test_x509_store.t ............... skipped: test_rehash is not available on this platform
60-test_x509_time.t ................ ok
61-test_bio_prefix.t ............... ok
65-test_cmp_asn.t .................. ok
65-test_cmp_client.t ............... ok
65-test_cmp_ctx.t .................. ok
65-test_cmp_hdr.t .................. ok
65-test_cmp_msg.t .................. ok
65-test_cmp_protect.t .............. skipped: This test is not supported in a shared library build on Windows
65-test_cmp_server.t ............... ok
65-test_cmp_status.t ............... ok
65-test_cmp_vfy.t .................. ok
66-test_ossl_store.t ............... ok
70-test_asyncio.t .................. ok
70-test_bad_dtls.t ................. ok
70-test_clienthello.t .............. ok
70-test_comp.t ..................... ok
70-test_key_share.t ................ ok
70-test_packet.t ................... ok
70-test_recordlen.t ................ ok
70-test_renegotiation.t ............ ok
70-test_servername.t ............... ok
70-test_sslcbcpadding.t ............ ok
70-test_sslcertstatus.t ............ ok
70-test_sslextension.t ............. ok
70-test_sslmessages.t .............. ok
70-test_sslrecords.t ............... ok
70-test_sslsessiontick.t ........... ok
70-test_sslsigalgs.t ............... ok
70-test_sslsignature.t ............. ok
70-test_sslskewith0p.t ............. ok
70-test_sslversions.t .............. ok
70-test_sslvertol.t ................ ok
70-test_tls13alerts.t .............. ok
70-test_tls13cookie.t .............. ok
70-test_tls13downgrade.t ........... ok
70-test_tls13hrr.t ................. ok
70-test_tls13kexmodes.t ............ ok
70-test_tls13messages.t ............ ok
70-test_tls13psk.t ................. ok
70-test_tlsextms.t ................. ok
70-test_verify_extra.t ............. ok
70-test_wpacket.t .................. skipped: Test disabled in this configuration
71-test_ssl_ctx.t .................. ok
80-test_ca.t ....................... ok
80-test_cipherbytes.t .............. ok
80-test_cipherlist.t ............... ok
80-test_ciphername.t ............... ok
80-test_cms.t ...................... 9/?
80-test_cms.t ...................... ok
80-test_cmsapi.t ................... ok
80-test_ct.t ....................... ok
80-test_dane.t ..................... ok
80-test_dtls.t ..................... ok
80-test_dtls_mtu.t ................. ok
80-test_dtlsv1listen.t ............. ok
80-test_http.t ..................... ok
80-test_ocsp.t ..................... ok
80-test_pkcs12.t ................... skipped: Non-Greek system locale
80-test_ssl_new.t .................. ok
80-test_ssl_old.t .................. ok
80-test_ssl_test_ctx.t ............. ok
80-test_sslcorrupt.t ............... ok
80-test_tsa.t ...................... ok
80-test_x509aux.t .................. ok
81-test_cmp_cli.t .................. skipped: Tests involving CMP server not available on Windows or VMS
90-test_asn1_time.t ................ ok
90-test_async.t .................... ok
90-test_bio_enc.t .................. ok
90-test_bio_memleak.t .............. ok
90-test_constant_time.t ............ ok
90-test_fatalerr.t ................. ok
90-test_gmdiff.t ................... ok
90-test_gost.t ..................... skipped: No test GOST engine found
90-test_ige.t ...................... ok
90-test_includes.t ................. ok
90-test_memleak.t .................. ok
90-test_overhead.t ................. ok
90-test_secmem.t ................... ok
90-test_shlibload.t ................ ok
90-test_srp.t ...................... ok
90-test_sslapi.t ................... ok
90-test_sslbuffers.t ............... ok
90-test_store.t .................... ok
90-test_sysdefault.t ............... ok
90-test_threads.t .................. ok
90-test_time_offset.t .............. ok
90-test_tls13ccs.t ................. ok
90-test_tls13encryption.t .......... ok
90-test_tls13secrets.t ............. ok
90-test_v3name.t ................... ok
95-test_external_boringssl.t ....... skipped: No external tests in this configuration
95-test_external_gost_engine.t ..... skipped: No external tests in this configuration
95-test_external_krb5.t ............ skipped: No external tests in this configuration
95-test_external_pyca.t ............ skipped: No external tests in this configuration
99-test_ecstress.t ................. ok
99-test_fuzz.t ..................... ok
All tests successful.
Files=212, Tests=3418, 2395 wallclock secs ( 9.58 usr +  0.97 sys = 10.55 CPU)
Result: PASS

  1. 提示PASS则表示test通过,随后可以执行nmake install进行正常安装了。
  2. 最后,将安装路径下的bin路径手动添加到环境变量PATH中。以后就可以命令行执行openssl相关命令了。至于在C工程中openssl相关调用和配置方式,则在另一个章节中进行讲解。