@@ -510,8 +510,6 @@ This section provides guidance on how to enable these settings in {project_name}
510510Configuring the database server with the private keys and certificates is outside the scope of this section.
511511Consult your vendor documentation on how to do it.
512512
513- === Using {project_name} CLI options
514-
515513{project_name} provides unified CLI options to configure database TLS settings across different database vendors.
516514These options simplify the configuration by abstracting vendor-specific JDBC properties and providing a consistent interface.
517515
@@ -545,214 +543,6 @@ Alternatively, you can use `--truststore-paths` instead of the `db-tls-trust-sto
545543
546544<@kc.start parameters="--db=postgres --db-tls-mode=verify-server --truststore-paths=/path/to/certificate.pem"/>
547545
548- === Using the Java truststore
549-
550- {project_name} allows adding certificates to the Java truststore using the CLI option `--truststore-paths`, which is supported by most drivers.
551- The recommended settings for each database are provided below.
552-
553- ==== PostgreSQL
554- // https://jdbc.postgresql.org/documentation/ssl/
555- PostgreSQL requires the following JDBC properties to be configured.
556-
557- [%autowidth]
558- |===
559- |JDBC Property |Value | Description
560-
561- m|sslmode
562- m|verify-full
563- |Encrypts the network traffic and validates the server identity.
564-
565- m|sslfactory
566- m|org.postgresql.ssl.DefaultJavaSSLFactory
567- |By default, the driver uses `LibPQFactory` which does not support the Java truststore.
568-
569- |===
570-
571- <@kc.start parameters="--truststore-paths=/path/to/database_cert.pem --db-url-properties=?sslmode=verify-full&sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory"/>
572-
573- ==== MySQL
574- // https://dev.mysql.com/doc/connector-j/en/connector-j-reference-using-ssl.html
575- MySQL requires the following JDBC property to be configured.
576-
577- [%autowidth]
578- |===
579- |JDBC Property |Value | Description
580-
581- m|sslMode
582- m|VERIFY_IDENTITY
583- |Encrypts the network traffic and validates the server identity.
584-
585- |===
586-
587- <@kc.start parameters="--truststore-paths=/path/to/database_cert.pem --db-url-properties=?sslMode=VERIFY_IDENTITY"/>
588-
589- [%autowidth]
590- ==== MariaDB
591- // https://mariadb.com/docs/connectors/mariadb-connector-j/using-tls-ssl-with-mariadb-java-connector
592- MariaDB requires the following JDBC property to be configured.
593-
594- |===
595- |JDBC Property |Value | Description
596-
597- m|sslMode
598- m|verify-full
599- |Encrypts the network traffic and validates the server identity.
600-
601- |===
602-
603- <@kc.start parameters="--truststore-paths=/path/to/database_cert.pem --db-url-properties=?sslMode=verify-full"/>
604-
605- [%autowidth]
606- ==== Microsoft SQL Server
607- // https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-with-ssl-encryption?view=sql-server-ver17#configuring-the-connection
608- Microsoft SQL Server requires the following JDBC properties to be configured.
609-
610- |===
611- |JDBC Property |Value | Description
612-
613- m|encrypt
614- m|true
615- |Encrypts the network traffic.
616-
617- m|trustServerCertificate
618- m|false
619- |Validates the server identity.
620-
621- |===
622-
623- <@kc.start parameters="--truststore-paths=/path/to/database_cert.pem --db-url-properties=;encrypt=true;trustServerCertificate=false"/>
624-
625- [%autowidth]
626- ==== Oracle
627- // https://docs.oracle.com/en/database/oracle/oracle-database/21/jajdb/oracle/jdbc/OracleDriver.html
628- Oracle by default verifies the server identity when the protocol `tcps` is used.
629-
630- <@kc.start parameters="--truststore-paths=/path/to/database_cert.pem --db-url=jdbc:oracle:thin:@tcps://host:port/database"/>
631-
632- === Using database-specific certificate paths
633-
634- Alternatively, instead of using the Java truststore with `--truststore-paths`, you can configure each database driver to use its own certificate file or truststore directly through JDBC properties.
635- This approach is useful when you want to keep database certificates separate from the Java truststore.
636-
637- ==== PostgreSQL
638-
639- PostgreSQL supports specifying the certificate file directly using the `sslrootcert` property.
640-
641- [%autowidth]
642- |===
643- |JDBC Property |Value | Description
644-
645- m|sslmode
646- m|verify-full
647- |Encrypts the network traffic and validates the server identity.
648-
649- m|sslrootcert
650- m|/path/to/cert.pem
651- |The path to the server's certificate file on the client machine.
652-
653- |===
654-
655- <@kc.start parameters="--db-url-properties=?sslmode=verify-full&sslrootcert=/path/to/cert.pem"/>
656-
657- ==== MySQL
658-
659- MySQL supports specifying the certificate file or truststore through dedicated SSL properties.
660-
661- [%autowidth]
662- |===
663- |JDBC Property |Value | Description
664-
665- m|sslMode
666- m|VERIFY_IDENTITY
667- |Encrypts the network traffic and validates the server identity.
668-
669- m|trustCertificateKeyStoreUrl
670- m|file:/path/to/truststore.jks
671- |The URL to a custom truststore file containing the server certificate.
672-
673- m|trustCertificateKeyStorePassword
674- m|password
675- |The password for the custom truststore (if required).
676-
677- |===
678-
679- <@kc.start parameters="--db-url-properties=?sslMode=VERIFY_IDENTITY&trustCertificateKeyStoreUrl=file:/path/to/truststore.jks&trustCertificateKeyStorePassword=password"/>
680-
681- ==== MariaDB
682-
683- MariaDB supports specifying the certificate file directly using the `serverSslCert` property.
684-
685- [%autowidth]
686- |===
687- |JDBC Property |Value | Description
688-
689- m|sslMode
690- m|verify-full
691- |Encrypts the network traffic and validates the server identity.
692-
693- m|serverSslCert
694- m|/path/to/cert.pem
695- |The path to the server's certificate file on the client machine.
696-
697- |===
698-
699- <@kc.start parameters="--db-url-properties=?sslMode=verify-full&serverSslCert=/path/to/cert.pem"/>
700-
701- ==== Microsoft SQL Server
702-
703- Microsoft SQL Server supports specifying a custom truststore using the `trustStore` and `trustStorePassword` properties.
704-
705- [%autowidth]
706- |===
707- |JDBC Property |Value | Description
708-
709- m|encrypt
710- m|true
711- |Encrypts the network traffic.
712-
713- m|trustServerCertificate
714- m|false
715- |Validates the server identity.
716-
717- m|trustStore
718- m|/path/to/truststore.jks
719- |The path to a custom truststore file containing the server certificate.
720-
721- m|trustStorePassword
722- m|password
723- |The password for the custom truststore.
724-
725- |===
726-
727- <@kc.start parameters="--db-url-properties=;encrypt=true;trustServerCertificate=false;trustStore=/path/to/truststore.jks;trustStorePassword=password"/>
728-
729- ==== Oracle
730-
731- Oracle supports using Oracle Wallet or Java keystores for certificate management.
732- When using `tcps` protocol, you can specify a custom keystore location.
733-
734- [%autowidth]
735- |===
736- |JDBC Property |Value | Description
737-
738- m|javax.net.ssl.trustStore
739- m|/path/to/truststore.jks
740- |The path to a custom truststore file containing the server certificate.
741-
742- m|javax.net.ssl.trustStorePassword
743- m|password
744- |The password for the custom truststore.
745-
746- m|javax.net.ssl.trustStoreType
747- m|JKS
748- |The type of truststore (JKS, PKCS12, etc.).
749-
750- |===
751-
752- <@kc.start parameters="--db-url=jdbc:oracle:thin:@tcps://host:port/database --db-url-properties=?javax.net.ssl.trustStore=/path/to/truststore.jks&javax.net.ssl.trustStorePassword=password&javax.net.ssl.trustStoreType=JKS"/>
753-
754- Alternatively, you can use Oracle Wallet by configuring the wallet location in the JDBC URL or through Oracle-specific properties.
755-
756546== Setting JPA provider configuration option for migrationStrategy
757547
758548To setup the JPA migrationStrategy (manual/update/validate) you should setup JPA provider as follows:
0 commit comments