Skip to content

Commit c335f3d

Browse files
committed
back tls related.
1 parent 1e51f5a commit c335f3d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export interface ClientConfig {
2929
tlsTrustCertsFilePath?: string;
3030
tlsValidateHostname?: boolean;
3131
tlsAllowInsecureConnection?: boolean;
32+
tlsCertificateFilePath?: string;
33+
tlsPrivateKeyFilePath?: string;
3234
statsIntervalInSeconds?: number;
3335
log?: (level: LogLevel, file: string, line: number, message: string) => void;
3436
}

src/Client.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ static const std::string CFG_USE_TLS = "useTls";
3838
static const std::string CFG_TLS_TRUST_CERT = "tlsTrustCertsFilePath";
3939
static const std::string CFG_TLS_VALIDATE_HOSTNAME = "tlsValidateHostname";
4040
static const std::string CFG_TLS_ALLOW_INSECURE = "tlsAllowInsecureConnection";
41+
static const std::string CFG_TLS_CERTIFICATE_FILE_PATH = "tlsCertificateFilePath";
42+
static const std::string CFG_TLS_PRIVATE_KEY_FILE_PATH = "tlsPrivateKeyFilePath";
4143
static const std::string CFG_STATS_INTERVAL = "statsIntervalInSeconds";
4244
static const std::string CFG_LOG = "log";
4345

@@ -175,6 +177,12 @@ Client::Client(const Napi::CallbackInfo &info) : Napi::ObjectWrap<Client>(info)
175177
pulsar_client_configuration_set_validate_hostname(cClientConfig.get(), tlsValidateHostname.Value());
176178
}
177179

180+
if (clientConfig.Has(CFG_TLS_ALLOW_INSECURE) && clientConfig.Get(CFG_TLS_ALLOW_INSECURE).IsBoolean()) {
181+
Napi::Boolean tlsAllowInsecureConnection = clientConfig.Get(CFG_TLS_ALLOW_INSECURE).ToBoolean();
182+
pulsar_client_configuration_set_tls_allow_insecure_connection(cClientConfig.get(),
183+
tlsAllowInsecureConnection.Value());
184+
}
185+
178186
if (clientConfig.Has(CFG_TLS_ALLOW_INSECURE) && clientConfig.Get(CFG_TLS_ALLOW_INSECURE).IsBoolean()) {
179187
Napi::Boolean tlsAllowInsecureConnection = clientConfig.Get(CFG_TLS_ALLOW_INSECURE).ToBoolean();
180188
pulsar_client_configuration_set_tls_allow_insecure_connection(cClientConfig.get(),

0 commit comments

Comments
 (0)