Caused by: java.lang.RuntimeException: default directory must be absolute at sun.nio.fs.UnixFileSystem.
(UnixFileSystem.java:54) at sun.nio.fs.LinuxFileSystem. (LinuxFileSystem.java:39) at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(LinuxFileSystemProvider.java:43) at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(LinuxFileSystemProvider.java:36) at sun.nio.fs.UnixFileSystemProvider. (UnixFileSystemProvider.java:55)
The default directory path was absolute, so this error made no sense. Eventually I tracked down the source of the issue: a known Java bug (JDK-7181721)! That's something one doesn't run into every day – virtually 100% of the time, the bug is either in your own code, or someone else's code that you're relying on – not the code that's actually part of Java. This is so unusual that I was suspicious I was wrong at first. So I came up with a workaround that avoided this code, and sure enough that fixed it.
The workaround? It turns out that the socket factory as a completely separate way to get the certificates. You can create a Keystore object (in memory) and load it yourself, then pass that in. I did that this morning, and bye-bye problem.
I'd be quite happy to not run into another one of these! On the other hand, finding and fixing such a bizzaro problem is kind of satisfying...