Skip to content

Commit fb181a0

Browse files
author
Spike
committed
ae.net.ssl.openssl: Make deprecated setCipherList an override, not an alias
A `deprecated alias` does not override the base SSLContext virtual method, so calls dispatched through an `SSLContext` reference would hit the base's "not implemented" stub at runtime instead of the OpenSSL implementation. Replace the alias with a deprecated `override` forwarder and add a regression test that exercises virtual dispatch through the base reference.
1 parent 1246c94 commit fb181a0

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

net/ssl/openssl.d

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,11 @@ class OpenSSLContext : SSLContext
250250
}
251251
}
252252

253-
deprecated alias setCipherList = setOpenSSLCipherList; /// ditto
253+
deprecated("Use setOpenSSLCipherList directly on OpenSSLContext, or setCipherSuites for a portable alternative")
254+
override void setCipherList(string[] ciphers)
255+
{
256+
setOpenSSLCipherList(ciphers);
257+
} /// ditto
254258

255259
override void enableDH(int bits)
256260
{
@@ -943,6 +947,14 @@ debug(ae_unittest) unittest
943947
ctx.setCipherSuites(["TLS_AES_256_GCM_SHA384"]);
944948
}
945949

950+
// Test that the deprecated setCipherList still works at runtime when called via SSLContext
951+
// base reference (does not hit the base's "not implemented" assert).
952+
deprecated debug(ae_unittest) unittest
953+
{
954+
SSLContext ctx = new OpenSSLContext(SSLContext.Kind.client);
955+
ctx.setCipherList(["HIGH"]); // virtual dispatch must reach OpenSSL impl
956+
}
957+
946958
// Test setIdentityFromPKCS12: generate a self-signed cert in-memory and round-trip via PFX.
947959
debug(ae_unittest) unittest
948960
{

0 commit comments

Comments
 (0)