Skip to content

Instantly share code, notes, and snippets.

@jonbartels
Last active April 11, 2024 19:47
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jonbartels/8abd121901eb930f46245d9ef0f5710e to your computer and use it in GitHub Desktop.
Save jonbartels/8abd121901eb930f46245d9ef0f5710e to your computer and use it in GitHub Desktop.
Mirth Connect has many ways to manage SSL connections. This gist provides a primer on how to manage them. Edits, contributions, and corrections are appreciated!

Mirth Connect is awesome! One common question on the forums and Slack is how to manage SSL connctions. These questions mainly focus on HTTPS but also include TCP connections.

The quick rundown is:

  1. The built-in MC HTTP Sender connector will do HTTPS if:
  • The endpoint has a certificate which is signed by a CA already present in the JVM truststore and has the right DN or SAN for the hostname. This is logically equivalent to the "green check" if you open the URL in a browser.
  • The certificate has been added to the truststore for the JVM that MC is running under
  • Changes to DNS or host files allow a hostname to match the DN or SAN already present in the cert (not reccomended)
  • The connector may flag these connections with a warning or red x. Test the channel first as the validator makes assumptions about SSL that may not apply in this case.
  1. The built-in MC HTTP Listener connector will not do SSL directly. A plugin or a proxy is necessary.
  1. SSL firewalls or stunnel can also proxy the SSL connections. MC connects to the unsecured side of the tunnel and the SSL layer is handled on the other side. Open source tools:
  1. Commercial solutions
  1. Channel code - You can use tools like Apache HTTP Commons or OKHttp in MC and use that code to deal with SSL

The main consideration between these options are:

  • Who is expected to manage the connections? Interface engineers benefit from options plugins that keep this inside MC. Network engineers and devops will tend to prefer proxies and tunnels that are closer to the infrastructure layer than the application layer.
  • When will certs expire and what are the corporate policies about cert management? Most certificates are good for 1 to 3 years, that means that updates are required as the certificates expire. What option is easies for your organization to a) detect this expiration and b) update certificates BEFORE they expire as routine maintenance?
  • What other software in your environment uses SSL and how is that managed?

Additional examples and references:

@hishamrashdan
Copy link

Hello
thanks a lot for this valuable information
if we need more information about the above mention points can you please suggest references or more articles talked in depth
about each point.

I also notice that the following link https://kailo.tech/health-it/mirth-connect-add-ssl/ is not working

Regards,
Hisham Alrashdan

@wshallwshall
Copy link

@jonbartels Thanks for this info!
This (and all the other stuff I'm finding) talks about encryption for HTTP connectors
Can you help with how to set up TLS for a TCP connector?

@jonbartels
Copy link
Author

@wshallwshall - The Zen SSLEXT supports TCP with SSL if you just want to hit the easy button.

Otherwise the same general points apply - an endpoint presenting a fully signed certificate chain should "just work", using stunnel or nginx to manage SSL connections will also work.

@pacmano1
Copy link

Open source tools:

Be mindful that these tools may or may not be compliant with USA healthcare securtiry requirements as it pertains to encryption of data end to end.

@ChristopherSchultz
Copy link

Anything which does standard SSL/TLS should be acceptable under HIPAA/HITECH in the US and similar regulations elsewhere. All of the open source tools @pacmano1 mentions use OpenSSL under the hood, at least in their standard packaging.

I've had great success with stunnel but I'm in a *NIX environment where it is more natural than, say, Microsoft Windows. IMHO, haproxy and nginx are overkill for this application.

@pacmano1
Copy link

@ChristopherSchultz - I was referring to the occassional arguments with clients who do their own security assessments and say "we don't consider SSL termination without encryption from the offloader machine to the end machine to be fully compliant to USA healthcare security requirement".

@ChristopherSchultz
Copy link

Aha.

Whenever I'm using stunnel, it's terminating "real" network connections using TLS and proxying to (always!) localhost non-encrypted connections. Yes, it's possible to terminate TLS on one machine and proxy to another machine on the network, but that (for me) violates what is now called TNO ("Trust No One") / Zero-Trust architecture. We (at $work) have operated this way since the beginning using the policy of "no privileged network positions".

Non-encrypted connections to localhost ought to be okay for most network security folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment