Step 1: install the SSL
sudo apt-get install openssl
Verifying the installation
Change directory to <REFERENCE_IMPLEMENTATION>/samples/javaclient.
cd <REFERENCE_IMPLEMENTATION>/samples/javaclient – //your sample apps location
Step 2: modify the SSL configuration file: SSL.cnf, all variables beginning YOUR_ values are replaced with real values.
Note that countryName must be two characters. If it is not two characters, certificate creation will fail. Here's what the ssl.cnf file would look like, replacing country, state, locality with your respective info.
Please note the country name must be two characters. If not two characters may fail to create the certificate. Click here and you will see what SSL.cnf, replace your nation, Chau, corresponding to the area of information
Step 3: set the following file to the executable's properties:
chmod +x generate.sh
Step 4: run the script and generate certificates:
Step 5: you will be prompted to enter some information in the process:
1. prompt for the product ID, please enter my_device
2. prompts for a serial number, enter 123456
3. the prompt for a password, enter the password you want, for example: talktome (or leave blank)
Step 6: Edit the Node.js server configuration file
The following changes are made:
SslKey set to <REFERENCE_IMPLEMENTATION>/samples/javaclient/certs/server/node.key
Set the sslCert to <REFERENCE_IMPLEMENTATION>/samples/javaclient/certs/server/node.CRT
SslCaCert set to <REFERENCE_IMPLEMENTATION>/samples/javaclient/certs/CA/CA.CRT
Note: do not use the ~ represents the root directory.You must use an absolute path.
Therefore, do not use the ~/documents/samples, and/home/PI/documents/samples.
Step 7: Edit the configuration of the JAVA client files
This configuration file is in the following location:
Make the following configurations:
Set companionApp.sslKeyStore to <REFERENCE_IMPLEMENTATION>/samples/javaclient/certs/Server/Jetty.PKCS12
Set companionApp.sslKeyStorePassphrase to the fifth step of the above certificate is generated code in the password
Set companionService.sslClientKeyStore to <REFERENCE_IMPLEMENTATION>/samples/javaclient/certs/client/client.PKCS12
Set companionService.sslClientKeyStorePassphrase to the fifth step of the above certificate is generated code in the password
Set companionService.sslCaCert to <REFERENCE_IMPLEMENTATION>/samples/javaclient/certs/CA/CA.CRT