@@ -77,9 +77,6 @@ def parse_args(in_args):
77
77
parser .add_argument ("--csr-attr" , type = str ,
78
78
help = "CSR attributes. Do not include CN (common name), the device ID will be used" ,
79
79
default = "" )
80
- parser .add_argument ("--install-ca" ,
81
- help = "Install the AWS root CA cert" ,
82
- action = 'store_true' , default = False )
83
80
parser .add_argument ("--coap" ,
84
81
help = "Install the CoAP server root CA cert in addition to the AWS root CA cert" ,
85
82
action = 'store_true' , default = False )
@@ -333,10 +330,6 @@ def main(in_args):
333
330
if not retval :
334
331
error_exit (ser , 'Unable to communicate' )
335
332
336
- # write CA cert(s) to modem
337
- if args .install_ca or args .coap :
338
- install_ca_certs (args .sectag , args .stage , args .coap , args .noshell )
339
-
340
333
attest_tok = args .attest
341
334
if not attest_tok :
342
335
# get attestation token
@@ -474,9 +467,15 @@ def main(in_args):
474
467
if not prov_id :
475
468
error_exit (ser , 'Failed to obtain provisioning cmd ID' )
476
469
477
- # TODO: create provisioning command to install AWS root CA?
478
- # currently, provisioning client does not support large CAs,
479
- # such as the AWS root CA.
470
+ # create provisioning command to install server cert
471
+ print (local_style ('\n Creating provisioning command (server cert)...' ))
472
+ server_cert = ca_certs .get_ca_certs (args .coap , args .stage )
473
+ api_res = nrf_cloud_diap .create_provisioning_cmd_server_cert (args .api_key , dev_uuid ,
474
+ server_cert ,
475
+ sec_tag = args .sectag )
476
+ nrf_cloud_diap .print_api_result ("Prov cmd client cert response" , api_res , args .verbose )
477
+ if api_res .status_code != 201 :
478
+ error_exit (ser , 'CreateDeviceProvisioningCommand API call failed' )
480
479
481
480
# create provisioning finished command
482
481
print (local_style ('\n Creating provisioning command (finished)...' ))
0 commit comments