Install mqtts with moquette ssl

Install mqtts support authencation ssl .

Step 1: create file serverkeystore.jks

Run command.  answering the questions presented to you.

 

C:\Users\NXCOMM>keytool -keystore serverkeystore.jks -alias testserver -genkey -keyalg RSA

Enter keystore password:

Re-enter new password:

What is your first and last name?

  [Unknown]:  cu tran

What is the name of your organizational unit?

  [Unknown]:  plk

What is the name of your organization?

  [Unknown]:  plk

What is the name of your City or Locality?

  [Unknown]:  ho chi minh

What is the name of your State or Province?

  [Unknown]:  ho chi minh

What is the two-letter country code for this unit?

  [Unknown]:  VN

Is CN=cu tran, OU=plk, O=plk, L=ho chi minh, ST=ho chi minh, C=VN correct?

  [no]:  y

 

Enter key password for <testserver>

        (RETURN if same as keystore password):

Re-enter new password:

C:\Users\NXCOMM>

 

Note: Renember password for config in file config/moquette.conf.

Export file serverkeystore.jks with run command:

 

C:\Users\NXCOMM>keytool -export -alias testserver -keystore serverkeystore.jks -file testserver.crt

Enter keystore password:

Certificate stored in file <testserver.crt>

 

Step 2. Edit file config/moquette.conf

add code config ssl for broker

 

ssl_port 8883

jks_path config/serverkeystore.jks

key_store_password 123456

key_manager_password 123456

 

Remember  copy file serverkeystore.jks to folder config berfore restart  broker.

Step 3. Restart broker and mqtt client connect to address: ssl://localhost:8883 for check mqtts broker.

username/password: testuser/ passwd

You can add user in file  file config/password_file.conf

Note password encode with  sha256.

New
Related