Using TLS in foundationDB with JAVA Client

I have set up a TLS enabled cluster following the steps highlighted by @ajbeamon and have verified the behavior by trying to connect to the same using fdbcli and providing the necessary certificate and key files. But while connecting to the cluster from a java client showed some strange behavior. Setting the TLS paths in the network options while running the java client through Windows OS gave a TLS error but interestingly enough the same worked on a unix machine. The network options are set like this

    fdb.options().setTLSCertPath("path to cert file");
    fdb.options().setTLSCaPath("path to CA file");
    fdb.options().setTLSKeyPath("path to key file");
    fdb.options().setTLSVerifyPeers("Check.Valid=1".getBytes());

and the stacktrace looks like this :

Exception in thread “main” com.apple.foundationdb.FDBException: TLS error
at com.apple.foundationdb.FDB.Network_setOption(Native Method)
at com.apple.foundationdb.OptionsSet.setOption(OptionsSet.java:55)
at com.apple.foundationdb.NetworkOptions.setTLSCertPath(NetworkOptions.java:87)
at Transaction.main(Transaction.java:33)

can anyone please help if i am missing something here?

And also for the record layer i couldn’t find any way from which the TLS paths can be set in the network options from the java client. Is there any other way to specify the tls paths in java client itself?

I’m not aware of anyone else that has tried to use TLS from Windows, so sounds like there’s likely a bug here. Would you mind filing an issue for it on github?

There’s environment variables that you can set, which are detailed in Setting network options with environment variables.