keep certificate path builder shim
diff --git a/src/Apache.IoTDB/SessionPool.Builder.cs b/src/Apache.IoTDB/SessionPool.Builder.cs index 9daf83d..be8696a 100644 --- a/src/Apache.IoTDB/SessionPool.Builder.cs +++ b/src/Apache.IoTDB/SessionPool.Builder.cs
@@ -17,6 +17,7 @@ * under the License. */ +using System; using System.Collections.Generic; namespace Apache.IoTDB; @@ -108,6 +109,12 @@ return this; } + [Obsolete("Use SetClientCertificatePath instead.")] + public Builder SetCertificatePath(string certificatePath) + { + return SetClientCertificatePath(certificatePath); + } + public Builder SetClientCertificatePassword(string clientCertificatePassword) { _clientCertificatePassword = clientCertificatePassword;
diff --git a/src/Apache.IoTDB/TableSessionPool.Builder.cs b/src/Apache.IoTDB/TableSessionPool.Builder.cs index 45222bd..ab39c38 100644 --- a/src/Apache.IoTDB/TableSessionPool.Builder.cs +++ b/src/Apache.IoTDB/TableSessionPool.Builder.cs
@@ -111,6 +111,12 @@ return this; } + [Obsolete("Use SetClientCertificatePath instead.")] + public Builder SetCertificatePath(string certificatePath) + { + return SetClientCertificatePath(certificatePath); + } + public Builder SetClientCertificatePassword(string clientCertificatePassword) { _clientCertificatePassword = clientCertificatePassword;
diff --git a/tests/Apache.IoTDB.Tests/MtlsConfigurationTests.cs b/tests/Apache.IoTDB.Tests/MtlsConfigurationTests.cs index 62ad8d8..5e3b16f 100644 --- a/tests/Apache.IoTDB.Tests/MtlsConfigurationTests.cs +++ b/tests/Apache.IoTDB.Tests/MtlsConfigurationTests.cs
@@ -41,6 +41,23 @@ } [Test] + public void SessionPoolBuilder_AcceptsObsoleteCertificatePath() + { +#pragma warning disable CS0618 + var sessionPool = new SessionPool.Builder() + .SetHost("localhost") + .SetPort(6667) + .SetUseSsl(true) + .SetCertificatePath("/tmp/client.pfx") + .SetClientCertificatePassword("secret") + .SetRootCertificatePath("/tmp/root-ca.pem") + .Build(); +#pragma warning restore CS0618 + + Assert.That(sessionPool, Is.Not.Null); + } + + [Test] public void TableSessionPoolBuilder_AcceptsClientCertificateConfiguration() { var tableSessionPool = new TableSessionPool.Builder() @@ -56,6 +73,23 @@ } [Test] + public void TableSessionPoolBuilder_AcceptsObsoleteCertificatePath() + { +#pragma warning disable CS0618 + var tableSessionPool = new TableSessionPool.Builder() + .SetHost("localhost") + .SetPort(6667) + .SetUseSsl(true) + .SetCertificatePath("/tmp/client.pfx") + .SetClientCertificatePassword("secret") + .SetRootCertificatePath("/tmp/root-ca.pem") + .Build(); +#pragma warning restore CS0618 + + Assert.That(tableSessionPool, Is.Not.Null); + } + + [Test] public void ConnectionStringBuilder_ParsesMtlsConfiguration() { var builder = new IoTDBConnectionStringBuilder(