Details
Description
It would be nice to have a working code piece in this part of Authentication article: https://docs.couchbase.com/java-sdk/3.4/howtos/sdk-authentication.html#authenticating-the-java-client-by-certificate
Currently we have this:
KeyStore keyStore = loadKeyStore();
Authenticator authenticator = CertificateAuthenticator.fromKeyStore(
keyStore,
"keyStorePassword"
);
And it's a generic pseudocode piece. We need to substitute it with a working snippet:
private static KeyStore loadKeyStore() {
try (FileInputStream fis = new FileInputStream("/home/ihor/Java/src/main/java/my.keystore"))
catch (IOException | GeneralSecurityException e)
{ throw new RuntimeException(e); }}
Authenticator authenticator = CertificateAuthenticator.fromKeyStore(ks, "storepass");
Browser environment: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Reporter: Ihor Pavlov
E-mail: ihor.pavlov@couchbase.com