code: @Given("^I connect with JDBC and security type '(TLS|MD5|TRUST|CERT|LDAP|tls|md5|trust|cert|ldap)' to database '(.+?)' on host '(.+?)' and port '(.+?)' with user '(.+?)'( and password '(.+?)')?( and root ca '(.+?)')?(, crt '(.+?)')?( and key '(.+?)' certificates)?$")
      public void connectDatabasePostgres(String securityType, String database, String host, String port, String user, String foo1, String password, String foo2, String ca, String foo3, String crt, String foo4, String key) throws Exception {
          this.commonspec.getExceptions().clear();
          if ("TLS".equals(securityType) || "tls".equals(securityType) || "CERT".equals(securityType) || "cert".equals(securityType)) {
              commonspec.getLogger().debug("opening secure database");
              try {
                  this.commonspec.connectToPostgreSQLDatabase(database, host, port, user, password, true, ca, crt, key);
              } catch (Exception e) {
                  this.commonspec.getExceptions().add(e);
              }
          } else {
              commonspec.getLogger().debug("opening database");
              try {
                  this.commonspec.connectToPostgreSQLDatabase(database, host, port, user, password, false, ca, crt, key);
              } catch (Exception e) {
                  this.commonspec.getExceptions().add(e);
              }
          }
      }
docs: Connect to JDBC secured/not secured database
  
  @param database  database connection string
  @param host      database host
  @param port      database port
  @param user      database user
  @param password  database password
  @param ca        database self signed certs
  @param crt:      database certificate
  @param key:      database private key
  @throws Exception exception     *