build(deps): bump org.postgresql:postgresql from 42.7.7 to 42.7.8 (#24)
Bumps org.postgresql:postgresql from 42.7.7 to 42.7.8.
updated-dependencies:
- dependency-name: org.postgresql:postgresql dependency-version: 42.7.8 dependency-type: direct:production update-type: version-update:semver-patch …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
JDBC test application
This application can be used to test database connections set up with a JDBC URL, and report SSL/TLS information. Currently, the application only supports the following database engines:
It has been verified to run on the following IaaS platforms:
Generate JAR for deployment
This application is supposed to be deployed to Cloud Foundry, which requires a fat JAR for deployment. However, before the JAR is generated, the project needs some DB-specific adjustments. These can be made by running one of the configuration gradle tasks provided: either
configureForMysql,configureForPostgres, orconfigureForSQLServerdepending on the required database.After that, running
gradlew bootJarwill produce a JAR pre-configured for the indicated database engine inbuild/libs.Automatic TLS Certificate extraction
By default, the generated JAR will contain a shell script that will automatically run on CloudFoundry and attempt to extract TLS certificates from the service binding. Currently supported services are:
In order to disable the script, build the JAR with a project flag
disableBindingTLSDetectionset tofalse, e.g.:Generating a sample manifest
Once the database engine is configured, a sample Cloud Foundry application manifest can be generated. Running
gradlew deploymentManifesttask will generate a sample manifest in the root of thebuilddirectory.GCP CloudSQL
On GCP, each CloudSQL instance gets its own CA and certificate generated, so the manifest will have to include additional environment variables in order to support this. The following flags are used to generate a manifest with TLS support on CloudSQL:
-P iaas=gcpThis flag is need in this exact form to set up the manifest to use instance-specific certificates, keys and CAs.-P keystorePassword=super-secret-password(Optional) It’s recommended to override the default password used in the keystore generated for the GCP deployment.Run the
deploymentManifestgradle task to generate a sample manifest in the root of thebuilddirectory:Deploying from this repository
It’s also possible to use gradle in order to deploy this application to Cloud Foundry. As the deployment task depends on the
bootJarand thedeploymentManifesttasks, it requires the same configuration, namely, running the database engine configuration tasks, and requiring the-P iaas=gcpflag when deploying to GCP with TLS support. The deployment tasks rely on the CF CLI, and expect it to be logged in.There are two gradle deployment tasks:
initialDeployanddeploy. The first is intended to deploy the app before binding it to a service, passing a--no-startflag to thecf pushcommand.Test endpoints
The application provides a set of Create (
POST /?name=<new-user-name>), Get (GET /<user-id>), List (GET /), and Delete (DELETE /<user-id>) operations on aUserentity, mounted at the application root. TheUseris an extremely simple entity that has only two attributes:idandname.SSL information endpoints
PostgreSQL
GET /postgres-sslprovides the fullpg_stat_sslreport on the current connection encoded as JSON, e.g.:Please Note:
clientDN,clientSerialandissuerDNwill be filled in only if a client certificate is used.version,cipherandbitsfields will only be filled in if the current database connection is secure.MySQL
GET /mysql-sslreports the ciphers used for the current connection, e.g.:The value will only be blank if the database connection is not encrypted.
Troubleshooting
The application won’t start with the following error message
This problem can be resolved by one of the following options:
spring.flyway.baseline-on-migratetotrueand propertyspring.flyway.baseline-versionto0