Skip to content

Commit 8930b78

Browse files
committed
GH-329 Update documentation about the recent OPENSSL_Applink changes.
Closes #411.
1 parent bf3d907 commit 8930b78

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

Changes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ Revision history for Perl extension Net::SSLeay.
2121
- LibreSSL on OpenBSD 6.9
2222
- LibreSSL on OpenBSD 7.1
2323
- Cygwin on x86_64
24+
- Fix compilation failure using cl. Microsoft cl compiler do
25+
not like when preprocessor directives are inside a
26+
macro. Fixes GH-403. Thanks to Jean-Damien Durand.
27+
- Update CTX_use_PKCS12_file() and CTX_use_PKCS12_file() to
28+
use BIO functions for avoiding "no OPENSSL_Applink" runtime
29+
errors. Fixes GH-281 and RT#101638. Thanks to Jean-Damien
30+
Durand.
31+
- Add to README.Win32 more information about OPENSSL_Applink
32+
and how it may be needed with FILE pointers and POSIX/Unix
33+
fds. Recommended method is to avoid them and use OpenSSL BIO
34+
functions instead. Update SSLeay.pod with alternatives to
35+
Net::SSLeay::SESSION_print_fp(). Closes GH-411.
2436
- Refactor variable declarations in RSA_generate_key to allow SSLeay.xs to
2537
compile under -Werror=declaration-after-statement. Fixes GH-407. Thanks to
2638
dharanlinux for the report.

README.Win32

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@ Building on Win 32 platforms
66
10.7.2007. Complete rewrite to agree with latest version 1.31. References to
77
ancient versions and untested procedures removed --mikem
88
22.4.2010 Updated info for 64 bit versions --mikem
9+
23.12.2022 Update OPENSSL_Applink for 1.93_02 and later --hvn
910

1011
Notes:
1112

12-
1. With some combinations of Windows, perl, compiler and compiler options, you
13+
1. "no OPENSSL_Applink" runtime error
14+
Changes in Net::SSLeay 1.93_02 fix this error with
15+
Net::SSLeay::P_PKCS12_load_file and Net::SSLeay::CTX_use_PKCS12_file
16+
functions. The error is caused when a file pointer or descriptor (FILE
17+
*, POSIX/unix fd) is passed between boundaries, as described
18+
below. Recommended fix is to use OpenSSL BIO API. Net::SSLeay still
19+
exposes SSL_SESSION_print_fp() which expects a FILE * as its first
20+
argument. See Net::SSLeay manual for more information about
21+
Net::SSLeay::SESSION_print_fp() and a possible workaround.
22+
23+
Information for Net::SSLeay 1.93_01 and earlier follows:
24+
With some combinations of Windows, perl, compiler and compiler options, you
1325
may see a runtime error "no OPENSSL_Applink", when calling
1426
Net::SSLeay::P_PKCS12_load_file. This appears to be due to incompatible
1527
compile options between the openssl libraries and Net::SSLeay. In particular

lib/Net/SSLeay.pod

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,8 +1972,9 @@ Examples:
19721972
#BEWARE: THIS IS WRONG - MEMORY LEAKS! (you cannot free @cachain items)
19731973
my ($privkey, $cert) = Net::SSLeay::P_PKCS12_load_file($filename, 1, $password);
19741974

1975-
B<NOTE> With some combinations of Windows, perl, compiler and compiler options, you
1976-
may see a runtime error "no OPENSSL_Applink", when calling
1975+
B<NOTE> Net::SSLeay 1.92_01 and earlier: With some combinations of
1976+
Windows, perl, compiler and compiler options, you may see a runtime
1977+
error "no OPENSSL_Applink", when calling
19771978
Net::SSLeay::P_PKCS12_load_file. See README.Win32 for more details.
19781979

19791980
=back
@@ -2226,6 +2227,11 @@ You have to use necessary BIO functions like this:
22262227

22272228
Prints session details (e.g. protocol version, cipher, session-id ...) to file handle.
22282229

2230+
B<NOTE> With some combinations of Windows, perl, compiler and compiler
2231+
options, you may see a runtime error "no OPENSSL_Applink", when
2232+
calling Net::SSLeay::SESSION_print_fp. See README.Win32 for more
2233+
details.
2234+
22292235
my $rv = Net::SSLeay::SESSION_print_fp($fp, $ses);
22302236
# $fp - perl file handle
22312237
# $ses - value corresponding to openssl's SSL_SESSION structure
@@ -2239,6 +2245,12 @@ Example:
22392245
open my $fh, ">", "output.txt";
22402246
Net::SSLeay::SESSION_print_fp($fh,$ses);
22412247

2248+
Similar functionality without Net::SSLeay::SESSION_print_fp
2249+
2250+
my $ses = Net::SSLeay::get_session($ssl);
2251+
my $bio = Net::SSLeay::BIO_new_file('output.txt', 'w');
2252+
Net::SSLeay::SESSION_print($bio, $ses);
2253+
22422254
=item * SESSION_set_time
22432255

22442256
Replaces the creation time of the session s with the chosen value $t (seconds since 1.1.1970).
@@ -3391,6 +3403,11 @@ Adds the certificate and private key from PKCS12 file $p12filename to $ctx.
33913403
#
33923404
# returns: 1 on success, 0 on failure
33933405

3406+
B<NOTE> Net::SSLeay 1.92_01 and earlier: With some combinations of
3407+
Windows, perl, compiler and compiler options, you may see a runtime
3408+
error "no OPENSSL_Applink", when calling
3409+
Net::SSLeay::CTX_use_PKCS12_file. See README.Win32 for more details.
3410+
33943411
=item * CTX_use_PrivateKey
33953412

33963413
Adds the private key $pkey to $ctx.

0 commit comments

Comments
 (0)