Wednesday, 5 October 2016

After all the stuff at amazon website, now the main work is of terminal.

  1. Download and install OpenSSL.
  2. Add the OpenSSL bin folder to the Windows PATH (see environment variables).
  3. Edit the ssl.cnf configuration file with your favorite text editor. Replace any placeholder values that start with YOUR_.
    Note: countryName must 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.
  4. Open a command prompt.
  5. Change directories to {REFERENCE_IMPLEMENTATION}\samples\javaclient.
  6. Type: set OPENSSL_CONF={OpenSSL installation location}\bin\openssl.cfg.
  7. Run the certificate generation script: generate.bat.
  8. During generation you will be prompted for some information (save this information -- you'll need it later):
    • When prompted for a productID, enter the productID (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.
  9. Edit the configuration file for the Node.js server. The configuration file is located in {REFERENCE_IMPLEMENTATION}\samples\companionService\config.js.
    • Set sslKey to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\node.key.
    • Set sslCert to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\node.crt.
    • Set sslCaCert to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\ca\\ca.crt.
  10. Edit the configuration file for the sample app. The configuration file is located at {REFERENCE_IMPLEMENTATION}\samples\javaclient\config.json.
    • Set companionApp.sslKeyStore to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\server\\jetty.pkcs12.
    • Set companionApp.sslKeyStorePassphrase to the password entered in the certificate generation script.
    • Set companionService.sslClientKeyStore to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\client\\client.pkcs12.
    • Set companionService.sslClientKeyStorePassphrase to the password entered in the certificate generation script.
    • Set companionService.sslCaCert to {REFERENCE_IMPLEMENTATION}\\samples\\javaclient\\certs\\ca\\ca.crt.

No comments:

Post a Comment