Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shadow_sample.c: get cert directory from command line argument does not work #238

Closed
SrikanthKrish opened this issue Oct 18, 2018 · 2 comments

Comments

@SrikanthKrish
Copy link

Directly running the shadow sample and sending the certificate directory via command line argument will not work, move call to parseInputArgsForconnectParams(argc,argv) before the sprintf's right above it.

    getcwd(CurrentWD, sizeof(CurrentWD));
snprintf(rootCA, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_ROOT_CA_FILENAME);
snprintf(clientCRT, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_CERTIFICATE_FILENAME);
snprintf(clientKey, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME);

IOT_DEBUG("rootCA %s", rootCA);
IOT_DEBUG("clientCRT %s", clientCRT);
IOT_DEBUG("clientKey %s", clientKey);

   parseInputArgsForConnectParams(argc, argv);
@gordonwang0
Copy link
Contributor

Hi @SrikanthKrish,

Thanks for bringing this to my attention! I've created a pull request (#241) to fix it.

@gordonwang0
Copy link
Contributor

#241 has been merged, so I will close this. Feel free to reopen if there's anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants