After all the stuff at amazon website, now the main work is of terminal.
- Download and install OpenSSL.
- Add the OpenSSL
binfolder to the Windows PATH (see environment variables). - Edit the
ssl.cnfconfiguration file with your favorite text editor. Replace any placeholder values that start withYOUR_.
Note:countryNamemust be two characters (e.g. US). If it is not two characters, certificate creation will fail. Additionally, if you will be accessing your device from any IP or DNS entry besides localhost (127.0.0.1 or 10.0.2.2), you must add the additional IP or or DNS entries to[alt_names]. One situation where you will need to add entries to[alt_names]is if you are going to authenticate using an Android or iOS companion app from a device instead of from the Android or iOS emulators on the same machine as the Node.js server and sample app. - Open a command prompt.
- Change directories to
{REFERENCE_IMPLEMENTATION}\samples\javaclient. - Type:
set OPENSSL_CONF={OpenSSL installation location}\bin\openssl.cfg. - Run the certificate generation script:
generate.bat. - During generation you will be prompted for some information (save this information -- you'll need it later):
- When prompted for a
productID, enter theproductID(or Device Type ID) listed under "Device Type Info" in the Amazon developer portal. - When prompted for a
serial number, enter your product's serial number. For prototyping purposes we recommend using: 123456. - When prompted for a
password, create a password (just don't forget it -- you'll need this soon). For prototyping purposes we recommend leaving password blank.
- When prompted for a
- Edit the configuration file for the Node.js server. The configuration file is located in
{REFERENCE_IMPLEMENTATION}\samples\companionService\config.js.- Set
sslKeyto{REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\node.key. - Set
sslCertto{REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\node.crt. - Set
sslCaCertto{REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\ca\\ca.crt.
- Set
- Edit the configuration file for the sample app. The configuration file is located at
{REFERENCE_IMPLEMENTATION}\samples\javaclient\config.json.- Set
companionApp.sslKeyStoreto{REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\jetty.pkcs12. - Set
companionApp.sslKeyStorePassphraseto the password entered in the certificate generation script. - Set
companionService.sslClientKeyStoreto{REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\client\\client.pkcs12. - Set
companionService.sslClientKeyStorePassphraseto the password entered in the certificate generation script. - Set
companionService.sslCaCertto{REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\ca\\ca.crt.
- Set
No comments:
Post a Comment