@@ -77,9 +77,6 @@ def parse_args(in_args):
7777 parser .add_argument ("--csr-attr" , type = str ,
7878 help = "CSR attributes. Do not include CN (common name), the device ID will be used" ,
7979 default = "" )
80- parser .add_argument ("--install-ca" ,
81- help = "Install the AWS root CA cert" ,
82- action = 'store_true' , default = False )
8380 parser .add_argument ("--coap" ,
8481 help = "Install the CoAP server root CA cert in addition to the AWS root CA cert" ,
8582 action = 'store_true' , default = False )
@@ -333,10 +330,6 @@ def main(in_args):
333330 if not retval :
334331 error_exit (ser , 'Unable to communicate' )
335332
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-
340333 attest_tok = args .attest
341334 if not attest_tok :
342335 # get attestation token
@@ -474,9 +467,15 @@ def main(in_args):
474467 if not prov_id :
475468 error_exit (ser , 'Failed to obtain provisioning cmd ID' )
476469
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' )
480479
481480 # create provisioning finished command
482481 print (local_style ('\n Creating provisioning command (finished)...' ))
0 commit comments