docs: @Override
    public void startSSPI() throws SQLException, IOException {
  
      /*
       * We usually use SSPI negotiation (spnego), but it's disabled if the client asked for GSSPI and
       * usespngo isn't explicitly turned on.
       */
      final String securityPackage = enableNegotiate ? "negotiate" : "kerberos";
  
      LOGGER.log(Level.FINEST, "Beginning SSPI/Kerberos negotiation with SSPI package: {0}", securityPackage);
  
      try {
        /*
         * Acquire a handle for the local Windows login credentials for the current user
         *
         * See AcquireCredentialsHandle
         * (http://msdn.microsoft.com/en-us/library/windows/desktop/aa374712%28v=vs.85%29.aspx)
         *
         * This corresponds to pg_SSPI_startup in libpq/fe-auth.c .
         */
        try {
          clientCredentials = WindowsCredentialsHandleImpl.getCurrent(securityPackage);
          clientCredentials.initialize();
        } catch (Win32Exception ex) {
          throw new PSQLException("Could not obtain local Windows credentials for SSPI",
              PSQLState.CONNECTION_UNABLE_TO_CONNECT /* TODO: Should be authentication error */, ex);
        }
  
        try {
          targetName = makeSPN();
  
          LOGGER.log(Level.FINEST, "SSPI target name: {0}", targetName);
  
          sspiContext = new WindowsSecurityContextImpl();
          sspiContext.setPrincipalName(targetName);
          sspiContext.setCredentialsHandle(clientCredentials);
          sspiContext.setSecurityPackage(securityPackage);
          sspiContext.initialize(null, null, targetName);
        } catch (Win32Exception ex) {
          throw new PSQLException("Could not initialize SSPI security context",
              PSQLState.CONNECTION_UNABLE_TO_CONNECT /* TODO: Should be auth error */, ex);
        }
  
        sendSSPIResponse(sspiContext.getToken());
        LOGGER.log(Level.FINEST, "Sent first SSPI negotiation message");
      } catch (NoClassDefFoundError ex) {
        throw new PSQLException(
            "SSPI cannot be used, Waffle or its dependencies are missing from the classpath",
            PSQLState.NOT_IMPLEMENTED, ex);
      }
    }