Skip to content

Commit 3551a32

Browse files
authored
ZTS: Fix zfs_load-key failures on F39
The zfs_load-key tests were failing on F39 due to their use of the deprecated ssl.wrap_socket function. This commit updates the test to instead use ssl.SSLContext() as described in https://stackoverflow.com/a/65194957. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #15534 Closes #15550
1 parent 95b68eb commit 3551a32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ if not httpd:
123123
with open('$HTTPS_PORT_FILE', 'w') as portf:
124124
print(port, file=portf)
125125

126-
httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, keyfile='/$TESTPOOL/snakeoil.key', certfile='$SSL_CA_CERT_FILE', ssl_version=ssl.PROTOCOL_TLS)
126+
sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
127+
sslctx.check_hostname = False
128+
sslctx.load_cert_chain(certfile='$SSL_CA_CERT_FILE', keyfile='/$TESTPOOL/snakeoil.key')
129+
httpd.socket = httpd.socket = sslctx.wrap_socket(httpd.socket, server_side=True)
127130

128131
os.chdir('$STF_SUITE/tests/functional/cli_root/zfs_load-key')
129132

0 commit comments

Comments
 (0)