Add client certificates

This commit is contained in:
Thomas Nordquist
2019-06-21 01:59:38 +02:00
parent bed5c74150
commit 38b16daf51
9 changed files with 243 additions and 37 deletions

View File

@@ -20,6 +20,8 @@ export interface ConnectionOptions {
encryption: boolean
certValidation: boolean
selfSignedCertificate?: CertificateParameters
clientCertificate?: CertificateParameters
clientKey?: CertificateParameters
clientId?: string
subscriptions: Array<string>
}
@@ -38,6 +40,8 @@ export function toMqttConnection(options: ConnectionOptions): MqttOptions | unde
certValidation: options.certValidation,
subscriptions: options.subscriptions,
certificateAuthority: options.selfSignedCertificate ? options.selfSignedCertificate.data : undefined,
clientCertificate: options.clientCertificate ? options.clientCertificate.data : undefined,
clientKey: options.clientKey ? options.clientKey.data : undefined,
}
}