Skip to content

Commit d04523d

Browse files
CA file seems to be issue. Ignore it for this sample
1 parent 963f28e commit d04523d

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

.github/workflows/ci_run_x509_connect_cfg.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
"secret": "ci/PubSub/key",
1919
"filename": "tmp_key.pem"
2020
},
21-
{
22-
"name": "--x509_ca_file",
23-
"secret": "ci/PubSub/ca",
24-
"filename": "tmp_ca.pem"
25-
},
2621
{
2722
"name": "--x509_endpoint",
2823
"secret": "ci/X509/endpoint_credentials"

samples/utils/command_line_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ def build_websocket_x509_mqtt_connection(self, on_connection_interrupted, on_con
250250
x509_tls_options = io.TlsContextOptions.create_client_with_mtls_from_path(
251251
self.get_command_required(self.m_cmd_x509_cert),
252252
self.get_command_required(self.m_cmd_x509_key))
253-
# x509_tls_options.ca_dirpath = self.get_command(self.m_cmd_x509_ca)
253+
if (self.get_command(self.m_cmd_x509_ca) != None):
254+
x509_tls_options.ca_dirpath = self.get_command(self.m_cmd_x509_ca)
254255
x509_tls_context = io.ClientTlsContext(x509_tls_options)
255256

256257
x509_provider = auth.AwsCredentialsProvider.new_x509(

samples/x509_connect.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ def on_connection_resumed(connection, return_code, session_present, **kwargs):
3535

3636

3737
if __name__ == '__main__':
38-
# TMP - enable logging
39-
io.init_logging(io.LogLevel.Error, 'stderr')
40-
4138
# Create a connection using X509 authentication to connect
4239
# Note: The data for the connection is gotten from cmdUtils.
4340
# (see build_websocket_x509_mqtt_connection for implementation)
@@ -52,11 +49,7 @@ def on_connection_resumed(connection, return_code, session_present, **kwargs):
5249
connect_future = mqtt_connection.connect()
5350

5451
# Future.result() waits until a result is available
55-
try:
56-
connect_future.result()
57-
except Exception as e:
58-
print (e)
59-
raise RuntimeError(e)
52+
connect_future.result()
6053
print("Connected!")
6154

6255
# Disconnect

0 commit comments

Comments
 (0)