Vert.x with Self-Signed SSL Cert

I recently noticed that my android app could no longer talk SSL directly to my Vert.x server (using a self-signed cert since it’s just for me). The client exception was:

    javax.net.ssl.SSLPeerUnverifiedException: Hostname example.com not verified

It turns out, Android 9 includes a documented change that requires certs to include a subjectAltName field.

Here’s how I now create my cert:

And how it’s used by Vert.x:

An alternative is to use a custom HostnameVerifier on the client-side.