After setting up custom nerves hub instance, I am able to create devices and products, add certificates via web. However, whenever I try to create them via command line e.g.:
mix nerves_hub.product create
I am getting this error:
Unhandled error: {:error, {:tls_alert, {:unknown_ca, 'TLS client: In state wait_cert at ssl_handshake.erl:1838 generated CLIENT ALERT: Fatal - Unknown CA\n'}}}
This is a staging setup and the domains are as:
- www.staging.mydomain.com - we are able to access this via browser and it shows it has a valid certificate issued by AWS.
- api.staging.mydomain.com - it shows the certificate is signed by NervesHub (as I deployed NH custom instance after creating an initial key-chain via nerves_hub repo) and browser also show this error of privacy alert. I had to add an exception to access this web page.
- device.staging.mydomain.com - same as above in no 2.
I have tried this both from Mac and Linux after adding these certificates to trusted generated by nerves hub. In code, I am telling it to load all these certificates from:
ca_certs = Path.expand("../ssl/prod", __DIR__)
I don’t know if this error is coming due to self signed certs or anything else. Is there any way I can resolve this error and be able to run these commands from my terminal against custom nerves hub instance and later after creating and installing image on our device, it is also able to communicate with our custom nerves hub instance.
Currently we are trying to achieve this without NervesKey.