Expose an API over HTTPS Mulesoft

Expose an API over HTTPS

    • Default HTTP Port - 80 in Mulesoft we use 8081.
    • Default HTTPS Port - 443 in Mulesoft we use 8082.

            Difference Between the HTTP and HTTPS :

     

              Steps:

                1. Open work space in project folder open cmd prompt .
                2. Write the command 

 to generate the key pair (public key associated with private key)
keytool -v -genkeypair -keyalg RSA -dname "cn=localhost, ou=demo, o=mani, c=US" -ext SAN="DNS:localhost,IP:127.0.0.1" -validity 365 -alias server -keystore "httpsdemo-dev.p12" -storetype pkcs12 -storepass "123456789"










               3. It created a HTTPS file (below reference)


                                                                                                                                                                  
             4. Add this file in project  src/main/resources/ 

       
           
              5. Complete certification import wizard : using    Next    Button .
                  (Below image for reference )

            
               6. Configuration  HTTP Listener.
    •   Change Protocol HTTP to HTTPS 
    •   Change port 8081 to 8082

  •     In  TLS :
    • Edit inline :
    • Type : pkcs12
    • path : httpsdemo-dev.p12
    • Alias: server
    • key password : 123456789
    • password: 123456789
                

             7. Test connection 

          8.  Setting in postman :

    •  In the settings you should change SSL (Secure Sockets Layer ) be Off.              

         9. Final Output



    Comments