Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5064373

Browse files
test(meson): fix SSLClientServerTest.* tests with OpenSSL 3.2.0 (yhirose#1940)
* build(meson): bump minimum version to 0.62.0 This allows making some minor cleanups * test(meson): fix SSLClientServerTest.* tests with OpenSSL 3.2.0 Since OpenSSL commit <openssl/openssl@342e365>, the default X.509 certificate format generated with the `openssl req` command has been changed to X.509 v3 from X.509 v1. For some reason, this change breaks cpp-httplib's SSLClientServerTest.* tests. To fix the test failures, this patch passes the '-x509v1' flag instead of '-x509' when OpenSSL 3.2.0 or newer is detected. To detect the version of a command line utility, Meson 0.62.0 or later is required. Fixes <yhirose#1798>, but only for the Meson build system.
1 parent 6c93aea commit 5064373

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

‎meson.build

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ project(
1313
'b_lto=true',
1414
'warning_level=3'
1515
],
16-
meson_version: '>=0.47.0'
16+
meson_version: '>=0.62.0'
1717
)
1818

1919
# Check just in case downstream decides to edit the source
@@ -98,20 +98,18 @@ if get_option('cpp-httplib_compile')
9898
)
9999
else
100100
install_headers('httplib.h')
101-
cpp_httplib_dep = declare_dependency(compile_args: args, dependencies: deps, include_directories: include_directories('.'))
101+
cpp_httplib_dep = declare_dependency(compile_args: args, dependencies: deps, include_directories: '.')
102102

103103
import('pkgconfig').generate(
104104
name: 'cpp-httplib',
105105
description: 'A C++ HTTP/HTTPS server and client library',
106-
install_dir: join_paths(get_option('datadir'), 'pkgconfig'),
106+
install_dir: get_option('datadir')/'pkgconfig',
107107
url: 'https://github.com/yhirose/cpp-httplib',
108108
version: version
109109
)
110110
endif
111111

112-
if meson.version().version_compare('>=0.54.0')
113-
meson.override_dependency('cpp-httplib', cpp_httplib_dep)
114-
endif
112+
meson.override_dependency('cpp-httplib', cpp_httplib_dep)
115113

116114
if get_option('cpp-httplib_test')
117115
subdir('test')

‎test/meson.build

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gtest_dep = dependency('gtest', main: true)
66
libcurl_dep = dependency('libcurl')
77
openssl = find_program('openssl')
88
test_conf = files('test.conf')
9+
req_x509_flag = openssl.version().version_compare('>=3.2.0') ? '-x509v1' : '-x509'
910

1011
key_pem = custom_target(
1112
'key_pem',
@@ -31,7 +32,7 @@ cert2_pem = custom_target(
3132
'cert2_pem',
3233
input: key_pem,
3334
output: 'cert2.pem',
34-
command: [openssl, 'req', '-x509', '-config', test_conf, '-key', '@INPUT@', '-sha256', '-days', '3650', '-nodes', '-out', '@OUTPUT@', '-extensions', 'SAN']
35+
command: [openssl, 'req', req_x509_flag, '-config', test_conf, '-key', '@INPUT@', '-sha256', '-days', '3650', '-nodes', '-out', '@OUTPUT@', '-extensions', 'SAN']
3536
)
3637

3738
key_encrypted_pem = custom_target(
@@ -44,7 +45,7 @@ cert_encrypted_pem = custom_target(
4445
'cert_encrypted_pem',
4546
input: key_encrypted_pem,
4647
output: 'cert_encrypted.pem',
47-
command: [openssl, 'req', '-x509', '-config', test_conf, '-key', '@INPUT@', '-sha256', '-days', '3650', '-nodes', '-out', '@OUTPUT@', '-extensions', 'SAN']
48+
command: [openssl, 'req', req_x509_flag, '-config', test_conf, '-key', '@INPUT@', '-sha256', '-days', '3650', '-nodes', '-out', '@OUTPUT@', '-extensions', 'SAN']
4849
)
4950

5051
rootca_key_pem = custom_target(
@@ -57,7 +58,7 @@ rootca_cert_pem = custom_target(
5758
'rootca_cert_pem',
5859
input: rootca_key_pem,
5960
output: 'rootCA.cert.pem',
60-
command: [openssl, 'req', '-x509', '-new', '-batch', '-config', files('test.rootCA.conf'), '-key', '@INPUT@', '-days', '1024', '-out', '@OUTPUT@']
61+
command: [openssl, 'req', req_x509_flag, '-new', '-batch', '-config', files('test.rootCA.conf'), '-key', '@INPUT@', '-days', '1024', '-out', '@OUTPUT@']
6162
)
6263

6364
client_key_pem = custom_target(
@@ -103,9 +104,9 @@ client_encrypted_cert_pem = custom_target(
103104
# Copy test files to the build directory
104105
configure_file(input: 'ca-bundle.crt', output: 'ca-bundle.crt', copy: true)
105106
configure_file(input: 'image.jpg', output: 'image.jpg', copy: true)
106-
subdir(join_paths('www', 'dir'))
107-
subdir(join_paths('www2', 'dir'))
108-
subdir(join_paths('www3', 'dir'))
107+
subdir('www'/'dir')
108+
subdir('www2'/'dir')
109+
subdir('www3'/'dir')
109110

110111
# GoogleTest 1.13.0 requires C++14
111112
test_options = []

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /