Skip to content

Commit d93c1ef

Browse files
committed
Fix compilation of set proto calls
The setter functions were added in OpenSSL 1.1.0 [1]. The patch fixes compilation for previous versions: /usr/bin/ld: $WORK/b079/_x030.o: in function `X_SSL_CTX_set_min_proto_version': ./shim.c:479: undefined reference to `SSL_CTX_set_min_proto_version' /usr/bin/ld: $WORK/b079/_x030.o: in function `X_SSL_CTX_set_max_proto_version': ./shim.c:483: undefined reference to `SSL_CTX_set_max_proto_version' 1. https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_min_proto_version.html
1 parent 4cc19a4 commit d93c1ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

shim.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,19 @@ int X_SSL_CTX_new_index() {
476476
}
477477

478478
int X_SSL_CTX_set_min_proto_version(SSL_CTX *ctx, int version) {
479+
#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
479480
return SSL_CTX_set_min_proto_version(ctx, version);
481+
#else
482+
return 0;
483+
#endif
480484
}
481485

482486
int X_SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version) {
487+
#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
483488
return SSL_CTX_set_max_proto_version(ctx, version);
489+
#else
490+
return 0;
491+
#endif
484492
}
485493

486494
long X_SSL_CTX_set_options(SSL_CTX* ctx, long options) {

0 commit comments

Comments
 (0)