Kerberos Drives a Seamless Email Experience

Over the last few years, I have written several times about building seamless experiences. This comes in different flavors depending on the operating system, such as iOS Single Sign-On powered by certificates and Kerberos or PCs using native kerberos authentication. Seamless identity can be achieved easily on modern applications, but what about on these archaic barbarians that don’t support SAML!?

On-Premise email is so much like Conan!

The subject that I speak of is no other than something that strikes fear in the hearts of even the strongest member of VMware’s professional services: Secure Email Gateway (SEG) and KCD (Kerberos Constrained Delegation) integration. KCD is very amazing because simply it allows you to deliver On-Premise Exchange-powered mobile email seamlessly without passwords by leveraging certificates and kerberos. My favorite part is it doesn’t even need a keytab! If you read my article here about setting up WS1 Access for Kerberos you know all about how much that sucks! Without further adieu, let’s discuss how to make this a reality. Here’s a small preview into what it looks like overall before we go into configuration and find the documentation here:

AirWatch SEG with KCD Architecture and Flow

Configuring KERBEROS in the UEM Console

This is a bit more complicated than it let’s on, but overall it’s not too terrible. Like most things, you just need to understand how they work. That’s why I’m here!

As you can see below, this is the advanced tab in Email > Configuration. You simply uncheck “Use Default Settings” and get to work.

SEG Advanced Settings Tab

Building the Chain

Let’s focus on a few key areas. First and foremost is the certificate. Certificate-chains are not particularly difficult to build. The way it works is Intermediate goes first and root goes second. I have a simple Linux one line command that eliminates any potential issues. One pro-tip, pull one of your WS1 UEM user certificates off your CA and download the intermediate and root certificates directly from the certificate chain tab. This is well worth it and eliminates any unknown variables.

cat intermediate-certificate.cer root-certificate.cer > chain-certificate.cer
openssl verify chain-certificate.cer

This is a simple and elegant way to create your root chain certificate without any text editor shenanigans. Afterwards the openssl command verifies the certificate is good. You will likely see this error below, but don’t worry about it. It’s not a big deal:

Cert Chain False Positives

Verifying and Entering the SPN

Obviously your Exchange team is doing most of this setup, but you should confirm implicitly that you have the right information. I typically recommend logging into Outlook and running a klist in the command prompt. Klist will show all of your kerberos tokens. You just want to find the one for Outlook to confirm what you are putting in the console is actually correct. the syntax is simple: HTTP/{User/Group or Server}. This should always be a computer account for the ASA (Alternate Service Account) since every Exchange environment is going to have multiple servers in production.

Verifying SPNs with KList

Another strong suggestion is to open up ADUC and verify the “Delegation” tab to ensure you see the SPNs for your Exchange URL and not individual servers in here because that will NOT work ever.

Validating SPNs for the Service Account

An error you may encounter if things are setup incorrectly can be seen below with something along the lines of “Couldn’t obtain token due to non-recoverable error”

Bad SPNs Log Lines

Wireshark is your best friend when looking at anything kerberos and it is pretty clear on the packet capture for this issue. You are going to see the Kerberos requests, but never a response because it’s requesting against an invalid SPN.


Credentials and Domain Mappings

Credentials are basic. Do not put the domain\ in there. That’s really it! You will see errors in the logs that are insane like mobilejon\ blah blah. So credentials are basic. The big challenge you “could” run into is with domains.

Hopefully most of you are dealing with a single domain. For those who aren’t, there’s three rules:

  1. Domain in all CAPS
  2. Map Domains to DCs in the same domain e.g. MOBILEJON.COM cannot decrypt tokens from SYNTEREX.COM. It will never work so be logical.
  3. Don’t use load balancing because this isn’t LDAP!

Time for more error logs to show if you are doing it wrong. The error you want to look out for is below. This is what happens when you try to decrypt a token for a different domain.

Decrypt Integrity check failed
SEG Kerberos Client Pipe Loglines

Customizing your Kerberos Settings

I definitely suggest looking at some of the settings in the Kerberos application properties before you start your build. You can find them in /opt/vmware/docker/seg/container/config/

Kerberos Settings

The main one that I recommend is to set the SEG to update/rebuild the kerberos config file on service restart. Some people like to leave this off after they have finished the build, but that will depend if you trust your people. As long as people don’t touch stuff they shouldn’t, it’s a good idea to leave it on.

Other options in here that are interesting include:

  • Forcing the SEG to validate the certificate thumbprint
  • Enable CRL checking
  • Determine if SEG will start if CRL is down
  • Hardcoding the CRL URL

The Certificate Template

One of the major challenges with WS1 UEM is how everything needs certificates. Below, you will find a recommended template that will cover all of your services including Tunnel to simplify things. For SEG, we mainly care about the UPN, which you can see is in the SAN.

The best Certificate Template

Load Balancing

Load Balancing is the true lynch pin of your entire SEG KCD build. I will tell you from experience do not say “there’s no way its the load balancer” because most times its the load balancer. Here’s a short list of the things you must avoid if you want to be able to do SEGv2 with KCD:

  • SSL Offloading
  • SSL Re-Encryption
  • Content Re-writing
  • Header Manipulation or Modification
  • Header Size Configuration or really any settings that have anything to do with headers

I promise if you avoid those items, you will be in really good shape. The main issue you will run into is the SSL security afterwards. Let’s talk about hardening the UAG’s SEG container.

SSL Hardening

SSL hardening will no longer happens at the load balancer when you move to KCD because it just can’t. Yes Kerberos is a pain in the ass, deal with it! First let me say, big props to the developers because building a JVM argument file is super useful. People struggle enough with Java as UEM engineers so this at least minimizes your issues.

Secondly, if you are using SEG you SHOULD be using Boxer with it. One of the current gaps is a SEG with ENSv2 will require you to enable a few weak ciphers (I know that sucks!), which means the last two ciphers on my config file below will need to be removed or you will not get real-time notifications for Boxer.

You will edit the Java properties for the SEG here below. This code will give you the most secured SEG container possible until they implement Perfect Forward Secrecy (PFS). Try not to be too alarmed when your SEG gets a B grade. They’re working on it I promise!


# Java Additional Parameters
-XX:OnError="jmap -dump:live,file=tmp/seg_on_error_dump.hprof-%p %p"
# Disable usage of vulnerable chiper suits for SSL Handshake.
# If unknown charset lookup failure should be ignored. Used during MIME header parsing.
# WARNING - Enable debug port only if needed. Also don't checkin your changes into Stash.
# # Map the port with a Host VM port and use that for remote access # -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=50000
# JMC settings start - These settings are used to enable Java Mission Control monitoring.
# -XX:+PrintGC
# Map this port with a Host VM port and use that for remote access #
# Change this IP to Container Host IP.
# -Djava.rmi.server.hostname=
# -XX:+UnlockCommercialFeatures
# -XX:+FlightRecorder
# JMC Settings ends.
# Syslog configuration starts - To direct application logs to Syslog server, set property "syslog.enabled" as true.
# Provide syslog server host, port and facility.
# By default, facility is set to USER (generic user-level messages) and port is 514.
# By default, appender is added for app logger, but it can be added to other loggers as well.
# Syslog configuration ends.

Setting your Log Levels for the Initial Build

I strongly suggest bumping up all of the Kerberos logs to DEBUG for the initial build, but honestly your security team would love you if they had those details in their SIEM. They’re found in a few locations. A Pro-tip for you: Do NOT modify these files directly in Linux. I personally love using WinSCP to do this because it’s simple and painless. It’s also cool to mention that you don’t need a service restart after increasing log levels. You typically just wait 1-2m before testing.


KCD Client Settings

Additionally, there’s other stuff you can look at too like DLL logging and ticket request retries, but I suggest you evaluate based on your experience.


logback.xml settings
More Logback.xml settings

Basic Troubleshooting

One of the main keys about how this whole thing works is understanding the flow. I will walk you through the steps so you can understand what to look for.

The SSL Handshake

The first part of the connection is the SSL handshake, but it might be a bit different than your typical handshake. The key difference is that after the server hello you will see the “Certificate Request” attribute where your UAG will send your email client a list of the certificates that are part of the client certificate chain you uploaded in the console.

Hello Message Phase of the SSL handshake

The Wireshark shows it nicely with a nifty filter: ssl.handshake.type=11. This should go smoothly provided that you did things the right way.

SSL Handshake Type 11

Certificate Functions

Once the handshake completes, you will see a number of things occur:

  • UAG connects to your CRL over HTTP to validate the certificate
  • UAG connects to the DC that matches your domain mapping to request a Kerberos token
  • UAG uses the Kerberos token to authenticate to Exchange and make the magic happen… because magic happens!
Its Magic!

Let’s hit on a few tips to make sure these things work correctly…


As mentioned in the documentation, you need to make sure your certificates are publishing a HTTP CRL. That does NOT mean HTTPs, or LDAP, it means HTTP (the one without the cute little lock icon).

Validation is pretty basic with a simple wget to see if you can connect and download your CRL. Again, this doesn’t mean OCSP, it means CRL.


We covered enough Kerberos so we will focus on Exchange. Basically, the UAG will present the kerberos token on your behalf to Exchange via a nice little OPTIONS call to see what can be supported. This “may” return a 401 if your token is bad.

Additionally, the nice thing is that the EWS endpoint for ENS will work straight out of the box for certificate-based authentication but you might have to walk back a config change you made when using basic authentication.

To fix the auth issue, you may have to modify something you may have originally modified to make basic authentication work on your UAG. You would just change the remove.unsupported.auth.for.ews=false to true.

Removing Unsupported Auths for EWS

Closing the Loop

I have to admit that outside of building the first VIDM in AWS leveraging RDS this was the hardest thing that I have had to tackle. It’s very daunting because of all of the moving pieces between load balancing, certificate, kerberos, etc. These are items that stress out a ton of people in the UEM space because they’re outside of our comfort zone. I will admit that I am thankful for a few people that were willing to help me navigating this dangerous terrain especially Wannes De Boodt who helped me narrow down some of the issues that I had and the PMs at VMware that had to endure the tornado that is Mobile Jon.

I beg all of you to use your community better and when difficult things come up to please use your peers. We are here to help you. If you are interested in doing any projects that are daunting or too time-consuming for you, I am available to consult and drive those projects to completion. I am many things, but the thing that I am most is stubborn and relentless.

8 thoughts on “Kerberos Drives a Seamless Email Experience”

  1. Pingback: Adding Resiliency to the Workspace ONE Secure Email Gateway with Kerberos Constrained Delegation - Mobile Jon's Blog

  2. Correct client certificate chain for KCD. The gui only supports a single .cer /chain file. However now I need to add a second .cer file while keeping the existing one too.

    The UAG config.json has the following setting
    “clientCertTrustStorePath” : null,

    But it does not work when I use;
    “clientCertTrustStorePath” : “/opt/vmware/docker/seg/container/config/ssl-certs/CAchain1.cer”,”/opt/vmware/docker/seg/container/config/ssl-certs/CAchain2.cer”,

    1. I sent you an email. So I just pinged the PM on slack.

      My guess is what he’s going to tell you which is probably the best idea is to stand up a separate UAG for the users on the old certificate. Personally, I’d regenerate everyone’s certificate but a separate UAG is also an option.

  3. Hi mobile-jon,

    Would you happen to know the syntax for adding multiple CA chains in the UAG config.json file;
    “clientCertTrustStorePath” : null,

    I just can’t get it to work.


    1. You typically do this by doing a deploy with the uagdeploy. I presume what you are really trying to do is deploy a new UAG with a .ini file right?

      In UAGDeploy, it would be trustedCert1, trustedCert2, etc e.g:


      1. The need is for kerberos constrained delegation (Certificate based authentication)

        The UAG using already built & configured for KCD with a CA Chain.

        Now a new CA chain needs to be added while keeping the existing chain.

      2. So you are referencing to the client certificate chain for KCD? You just need to upload that in the console and restart the SEG service.
        I don’t really like the JSON export and import. Did you already upgrade your UAGs to 2009 for custom Config file support for JVM?

      3. I misread your response. I don’t think you can have multiple trust chains for the KCD chain. Trust certificates themselves which reference stuff like the exchange server and CRL can obviously have multiple chains but the problem with trying to mess with something that is pushed down via Config file is any service restart is going to wipe out the setting you put in

Leave a Reply

Scroll to Top
%d bloggers like this: