Skip to content

Commit 81128a0

Browse files
PKCS12 builder support (#449)
Add PKCS12 support to MQTT builders. Add tests for PKCS12.
1 parent 050410b commit 81128a0

File tree

8 files changed

+174
-11
lines changed

8 files changed

+174
-11
lines changed

.builder/actions/crt-ci-test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ def _write_secret_to_temp_file(self, env, secret_name):
2828

2929
return filename
3030

31+
def _write_s3_to_temp_file(self, env, s3_file):
32+
try:
33+
tmp_file = tempfile.NamedTemporaryFile(delete=False)
34+
tmp_file.flush()
35+
tmp_s3_filepath = tmp_file.name
36+
cmd = ['aws', '--region', 'us-east-1', 's3', 'cp',
37+
s3_file, tmp_s3_filepath]
38+
env.shell.exec(*cmd, check=True, quiet=True)
39+
return tmp_s3_filepath
40+
except:
41+
print (f"ERROR: Could not get S3 file from URL {s3_file}!")
42+
raise RuntimeError("Could not get S3 file from URL")
43+
3144
def _build_and_run_eventstream_echo_server(self, env):
3245
java_sdk_dir = None
3346

@@ -89,6 +102,12 @@ def run(self, env):
89102

90103
env.shell.setenv("AWS_TESTING_COGNITO_IDENTITY", env.shell.get_secret("aws-c-auth-testing/cognito-identity"), quiet=True)
91104

105+
# PKCS12 setup (MacOS only)
106+
if (sys.platform == "darwin"):
107+
pkcs12_file_name = self._write_s3_to_temp_file(env, "s3://aws-crt-test-stuff/unit-test-key-pkcs12.pem")
108+
env.shell.setenv("AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY", pkcs12_file_name)
109+
env.shell.setenv("AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY_PASSWORD", "PKCS12_KEY_PASSWORD")
110+
92111
# Unfortunately, we can't use NamedTemporaryFile and a with-block because NamedTemporaryFile is not readable
93112
# on Windows.
94113
self._write_environment_script_secret_to_env(env, "mqtt5-testing/github-ci-environment")

MQTT5-UserGuide.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* [Direct MQTT with X509-based mutual TLS](#direct-mqtt-with-x509-based-mutual-tls)
2121
* [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication)
2222
* [Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication)
23+
* [Direct MQTT with PKCS11](#direct-mqtt-with-pkcs11-method)
24+
* [Direct MQTT with PKCS12](#direct-mqtt-with-pkcs12-method)
2325
* [HTTP Proxy](#http-proxy)
2426
* [Browser](#browser)
2527
* [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication-1)
@@ -267,6 +269,44 @@ token-signing fields to the value of the username that you assign within the cus
267269
add any custom authentication related values to the username in the CONNECT configuration optionally attached to the client configuration.
268270
The builder will do everything for you.
269271

272+
#### Direct MQTT with PKCS11 Method
273+
274+
A MQTT5 direct connection can be made using a PKCS11 device rather than using a PEM encoded private key, the private key for mutual TLS is stored on a PKCS#11 compatible smart card or Hardware Security Module (HSM). To create a MQTT5 builder configured for this connection, see the following code:
275+
276+
```typescript
277+
let pkcs11Options : Pkcs11Options = {
278+
pkcs11_lib: "<path to PKCS11 library>",
279+
user_pin: "<Optional pin for PKCS11 device>",
280+
slot_id: "<Optional slot ID containing PKCS11 token>",
281+
token_label: "<Optional label of the PKCS11 token>",
282+
private_key_object_label: "<Optional label of the private key object on the PKCS#11 token>",
283+
cert_file_path: "<Path to certificate file. Not necessary if cert_file_contents is used>",
284+
cert_file_contents: "<Contents of certificate file. Not necessary if cert_file_path is used>"
285+
};
286+
let builder = AwsIotMqtt5ClientConfigBuilder.newDirectMqttBuilderWithMtlsFromPkcs11(
287+
"<account-specific endpoint>",
288+
pkcs11Options
289+
);
290+
let client : Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());
291+
```
292+
293+
Note: Currently, TLS integration with PKCS#11 is only available on Unix devices.
294+
295+
#### Direct MQTT with PKCS12 Method
296+
297+
A MQTT5 direct connection can be made using a PKCS12 file rather than using a PEM encoded private key. To create a MQTT5 builder configured for this connection, see the following code:
298+
299+
```typescript
300+
let builder = AwsIotMqtt5ClientConfigBuilder.newDirectMqttBuilderWithMtlsFromPkcs12(
301+
"<account-specific endpoint>",
302+
"<PKCS12 file>",
303+
"<PKCS12 password>"
304+
);
305+
let client : Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());
306+
```
307+
308+
Note: Currently, TLS integration with PKCS#12 is only available on MacOS devices.
309+
270310
#### HTTP Proxy
271311
No matter what your connection transport or authentication method is, you may connect through an HTTP proxy
272312
by applying proxy configuration to the builder:

lib/native/aws_iot.spec.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as mqtt311 from "./mqtt";
1313
import * as aws_iot_mqtt311 from "./aws_iot";
1414
import { v4 as uuid } from 'uuid';
1515

16-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Mqtt over websockets with Non-Signing Custom Auth - Connection Success', async () => {
16+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Mqtt over websockets with Non-Signing Custom Auth - Connection Success', async () => {
1717

1818
let builder = aws_iot_mqtt311.AwsIotMqttConnectionConfigBuilder.new_builder_for_websocket();
1919
builder.with_custom_authorizer(
@@ -33,7 +33,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
3333
await connection.disconnect();
3434
});
3535

36-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Mqtt over websockets with Signing Custom Auth - Connection Success', async () => {
36+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Mqtt over websockets with Signing Custom Auth - Connection Success', async () => {
3737
let builder = aws_iot_mqtt311.AwsIotMqttConnectionConfigBuilder.new_builder_for_websocket();
3838
builder.with_custom_authorizer(
3939
test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_USERNAME,
@@ -51,3 +51,16 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
5151
await connection.connect();
5252
await connection.disconnect();
5353
});
54+
55+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasPKCS12Environment())('Aws Iot Core PKCS12 connection', async () => {
56+
let builder = aws_iot_mqtt311.AwsIotMqttConnectionConfigBuilder.new_mtls_pkcs12_builder({
57+
pkcs12_file : test_utils.ClientEnvironmentalConfig.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY,
58+
pkcs12_password : test_utils.ClientEnvironmentalConfig.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY_PASSWORD});
59+
builder.with_endpoint(test_utils.ClientEnvironmentalConfig.AWS_IOT_HOST);
60+
builder.with_client_id(`node-mqtt-unit-test-${uuid()}`)
61+
let config = builder.build();
62+
let client = new mqtt311.MqttClient();
63+
let connection = client.new_connection(config);
64+
await connection.connect();
65+
await connection.disconnect();
66+
});

lib/native/aws_iot.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,25 @@ export class AwsIotMqttConnectionConfigBuilder {
127127
return builder;
128128
}
129129

130+
/**
131+
* Create a new builder with mTLS using a PKCS#12 file for private key operations.
132+
*
133+
* Note: This configuration only works on MacOS devices.
134+
*
135+
* @param pkcs12_options - The PKCS#12 options to use in the builder.
136+
*/
137+
static new_mtls_pkcs12_builder(pkcs12_options: io.Pkcs12Options) {
138+
let builder = new AwsIotMqttConnectionConfigBuilder(TlsContextOptions.create_client_with_mtls_pkcs12_from_path(
139+
pkcs12_options.pkcs12_file, pkcs12_options.pkcs12_password));
140+
builder.params.port = 8883;
141+
142+
if (io.is_alpn_available()) {
143+
builder.tls_ctx_options.alpn_list.unshift('x-amzn-mqtt-ca');
144+
}
145+
146+
return builder;
147+
}
148+
130149
/**
131150
* Create a new builder with mTLS using a certificate in a Windows certificate store.
132151
*

lib/native/aws_iot_mqtt5.spec.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
3636
await test_utils.testConnect(new mqtt5.Mqtt5Client(builder.build()));
3737
});
3838

39-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Direct Mqtt Non-Signing Custom Auth - Connection Success', async () => {
39+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Direct Mqtt Non-Signing Custom Auth - Connection Success', async () => {
4040
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
4141
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_NAME,
4242
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_USERNAME,
@@ -51,7 +51,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
5151
await test_utils.testConnect(new mqtt5.Mqtt5Client(builder.build()));
5252
});
5353

54-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Success', async () => {
54+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Success', async () => {
5555
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
5656
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_NAME,
5757
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_USERNAME,
@@ -87,7 +87,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
8787
await test_utils.testConnect(new mqtt5.Mqtt5Client(builder.build()));
8888
});
8989

90-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Direct Mqtt Non-Signing Custom Auth - Connection Failure Bad Password', async () => {
90+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Direct Mqtt Non-Signing Custom Auth - Connection Failure Bad Password', async () => {
9191
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
9292
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_NAME,
9393
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_USERNAME,
@@ -102,7 +102,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
102102
await test_utils.testFailedConnection(new mqtt5.Mqtt5Client(builder.build()));
103103
});
104104

105-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Failure Bad Password', async () => {
105+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Failure Bad Password', async () => {
106106
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
107107
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_NAME,
108108
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_USERNAME,
@@ -120,7 +120,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
120120
await test_utils.testFailedConnection(new mqtt5.Mqtt5Client(builder.build()));
121121
});
122122

123-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Failure Bad Token Value', async () => {
123+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Failure Bad Token Value', async () => {
124124
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
125125
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_NAME,
126126
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_USERNAME,
@@ -138,7 +138,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
138138
await test_utils.testFailedConnection(new mqtt5.Mqtt5Client(builder.build()));
139139
});
140140

141-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Failure Bad Token Signature', async () => {
141+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Direct Mqtt Signing Custom Auth - Connection Failure Bad Token Signature', async () => {
142142
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
143143
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_NAME,
144144
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_USERNAME,
@@ -156,7 +156,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
156156
await test_utils.testFailedConnection(new mqtt5.Mqtt5Client(builder.build()));
157157
});
158158

159-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Websocket Mqtt Non-Signing Custom Auth - Connection Success', async () => {
159+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Websocket Mqtt Non-Signing Custom Auth - Connection Success', async () => {
160160
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
161161
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_NAME,
162162
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_USERNAME,
@@ -171,7 +171,7 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
171171
await test_utils.testConnect(new mqtt5.Mqtt5Client(builder.build()));
172172
});
173173

174-
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvironment())('Aws Iot Core Websocket Mqtt Signing Custom Auth - Connection Success', async () => {
174+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasCustomAuthEnvironment())('Aws Iot Core Websocket Mqtt Signing Custom Auth - Connection Success', async () => {
175175
let customAuthConfig : iot.MqttConnectCustomAuthConfig = {
176176
authorizerName: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_NAME,
177177
username: test_utils.ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_USERNAME,
@@ -188,3 +188,15 @@ test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasIotCoreEnvir
188188

189189
await test_utils.testConnect(new mqtt5.Mqtt5Client(builder.build()));
190190
});
191+
192+
test_utils.conditional_test(test_utils.ClientEnvironmentalConfig.hasPKCS12Environment())('Aws Iot Core PKCS12 - Connection Success', async () => {
193+
let builder = iot.AwsIotMqtt5ClientConfigBuilder.newDirectMqttBuilderWithMtlsFromPkcs12(
194+
test_utils.ClientEnvironmentalConfig.AWS_IOT_HOST,
195+
{
196+
pkcs12_file : test_utils.ClientEnvironmentalConfig.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY,
197+
pkcs12_password : test_utils.ClientEnvironmentalConfig.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY_PASSWORD
198+
}
199+
);
200+
await test_utils.testConnect(new mqtt5.Mqtt5Client(builder.build()));
201+
});
202+

lib/native/aws_iot_mqtt5.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,28 @@ export class AwsIotMqtt5ClientConfigBuilder {
140140
return builder;
141141
}
142142

143+
/**
144+
* Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via mutual TLS
145+
* using a PKCS12 file.
146+
*
147+
* Note: This configuration only works on MacOS devices.
148+
*
149+
* @param hostName - AWS IoT endpoint to connect to
150+
* @param pkcs12_options - The PKCS#12 options to use in the builder.
151+
*/
152+
static newDirectMqttBuilderWithMtlsFromPkcs12(hostName : string, pkcs12_options: io.Pkcs12Options) : AwsIotMqtt5ClientConfigBuilder {
153+
let builder = new AwsIotMqtt5ClientConfigBuilder(
154+
hostName,
155+
AwsIotMqtt5ClientConfigBuilder.DEFAULT_DIRECT_MQTT_PORT,
156+
io.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(pkcs12_options.pkcs12_file, pkcs12_options.pkcs12_password));
157+
158+
if (io.is_alpn_available()) {
159+
builder.tlsContextOptions.alpn_list.unshift('x-amzn-mqtt-ca');
160+
}
161+
162+
return builder;
163+
}
164+
143165
/**
144166
* Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via mutual TLS
145167
* using a certificate entry in a Windows certificate store.

lib/native/io.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,22 @@ export class SocketOptions extends NativeResource {
160160
}
161161
}
162162

163+
/**
164+
* Interface used to hold the options for creating a PKCS#12 connection in the builder.
165+
*
166+
* Note: Only supported on MacOS devices.
167+
*
168+
* NodeJS only
169+
* @category TLS
170+
*/
171+
export interface Pkcs12Options {
172+
/** Path to the PKCS#12 file */
173+
pkcs12_file: string;
174+
175+
/** The password for the PKCS#12 file */
176+
pkcs12_password : string;
177+
}
178+
163179
/**
164180
* Options for creating a {@link ClientTlsContext} or {@link ServerTlsContext}.
165181
*

test/mqtt5.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,34 @@ export class ClientEnvironmentalConfig {
5959
public static AWS_IOT_SIGNING_AUTHORIZER_TOKEN_SIGNATURE = process.env.AWS_TEST_MQTT5_IOT_CORE_SIGNING_AUTHORIZER_TOKEN_SIGNATURE ?? "";
6060
public static AWS_IOT_SIGNING_AUTHORIZER_TOKEN_KEY_NAME = process.env.AWS_TEST_MQTT5_IOT_CORE_SIGNING_AUTHORIZER_TOKEN_KEY_NAME ?? "";
6161

62+
public static AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY = process.env.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY ?? "";
63+
public static AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY_PASSWORD = process.env.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY_PASSWORD ?? "";
64+
6265
public static hasIotCoreEnvironment() {
6366
return ClientEnvironmentalConfig.AWS_IOT_HOST !== "" &&
6467
ClientEnvironmentalConfig.AWS_IOT_CERTIFICATE_PATH !== "" &&
6568
ClientEnvironmentalConfig.AWS_IOT_KEY_PATH !== "";
6669
}
6770

71+
public static hasCustomAuthEnvironment() {
72+
return ClientEnvironmentalConfig.AWS_IOT_HOST !== "" &&
73+
ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_NAME != "" &&
74+
ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_USERNAME != "" &&
75+
ClientEnvironmentalConfig.AWS_IOT_NO_SIGNING_AUTHORIZER_PASSWORD != "" &&
76+
ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_NAME != "" &&
77+
ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_USERNAME != "" &&
78+
ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_PASSWORD != "" &&
79+
ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_TOKEN != "" &&
80+
ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_TOKEN_SIGNATURE != "" &&
81+
ClientEnvironmentalConfig.AWS_IOT_SIGNING_AUTHORIZER_TOKEN_KEY_NAME != "";
82+
}
83+
84+
public static hasPKCS12Environment() {
85+
return ClientEnvironmentalConfig.AWS_IOT_HOST !== "" &&
86+
ClientEnvironmentalConfig.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY !== "" &&
87+
ClientEnvironmentalConfig.AWS_TEST_MQTT311_IOT_CORE_PKCS12_KEY_PASSWORD !== ""
88+
}
89+
6890
public static DIRECT_MQTT_HOST = process.env.AWS_TEST_MQTT5_DIRECT_MQTT_HOST ?? "";
6991
public static DIRECT_MQTT_PORT = parseInt(process.env.AWS_TEST_MQTT5_DIRECT_MQTT_PORT ?? "0");
7092
public static DIRECT_MQTT_BASIC_AUTH_HOST = process.env.AWS_TEST_MQTT5_DIRECT_MQTT_BASIC_AUTH_HOST ?? "";
@@ -415,7 +437,7 @@ export async function willTest(publisher: mqtt5.Mqtt5Client, subscriber: mqtt5.M
415437
publisher.stop({
416438
reasonCode: mqtt5.DisconnectReasonCode.DisconnectWithWillMessage
417439
});
418-
440+
419441
await willReceived;
420442
await publisherStopped;
421443

0 commit comments

Comments
 (0)