DZone
Integration Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Integration Zone > How to SSL Your APIs in Mule ESB

How to SSL Your APIs in Mule ESB

You can use a self-signed certificate for your SSL API in Mule ESB to create an HTTPS-based API. Just add the certificate to the project and use SSL for API.

Harish Kumar user avatar by
Harish Kumar
·
Mar. 23, 17 · Integration Zone · Tutorial
Like (5)
Save
Tweet
9.39K Views

Join the DZone community and get the full member experience.

Join For Free

In my previous blog, I showed you how to create a self-signed certificate for your SSL API. 

In this blog, I will be showing how you can use this certificate in Mule ESB to create an HTTPS-based API.

Screen Shot 2017-03-18 at 19.20.04

Adding Certificate to Project

Let's add the certificate to our project src/main/resources folder. We will be using this to add TLS/SSL to our HTTP endpoint listener.

Screen Shot 2017-03-18 at 19.18.27

As shown in the image, we have added localserver.p12 to the project resources folder.

You can also create a subfolder and add your certificate to it, but make sure you use the proper location of certificate while adding it to the HTTP listener in your config file.

Using SSL for API

Once you are done adding the certificate to your project resources, let's drag and drop an HTTP listener to your Mule config file and start configuring the listener and adding the certificate detail to your listener.

Screen Shot 2017-03-18 at 19.19.21

After adding the certificate detail to your listener, add a set payload to get the response in your browser.

Screen Shot 2017-03-18 at 20.11.09

We will be calling our API at this URL: https://localhost:4443/localapi. 

When you call the above URL in your browser, be aware that you will be welcomed with an error message/warning by the browser saying that your connection isn't private.

Various browsers may use different words, but the root cause is same: the certificate you are using is not certified by a Certificate Authority (CA).

Screen Shot 2017-03-18 at 20.18.49

To overcome this error, you can go to Advanced, add the exception to your browser, and refresh the page. You will be able to see the response from the API.

Screen Shot 2017-03-18 at 20.19.10

This will be the output:

Screen Shot 2017-03-18 at 20.19.16

With this tutorial, you can see how to add HTTPS to your API in Mule ESB. 

Watch the video tutorial below.

Enterprise service bus

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Artificial Intelligence (AI) And Its Assistance in Medical Diagnosis
  • Applying Domain-Driven Design Principles to Microservice Architectures
  • How to Solve Context Propagation Challenges in Distributed Tracing
  • Model Quantization for Edge AI

Comments

Integration Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo