vitess-gh/test/client_jdbc.sh

53 строки
2.6 KiB
Bash
Исходник Обычный вид История

#!/bin/bash
# Copyright 2019 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is a wrapper script that installs and runs the example
# client for the JDBC interface.
set -e
Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL (#2349) Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Trying unit tests with larger SSL key size Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increase CA cert size to 2048 bits Increase CA cert size to 2048 bits Disables basic TLS tests Re-enables but disables Somewhat decouples JDBC TLS unit tests Ensures that vtgateclienttest mocks terminate after each test suite Adds delay in unit tests to make sure VTGate has time to start and stop Adds logging of vtgateclienttest output Restores as a subclass of bugfix Reverts temporary changes Trying unit tests with larger SSL key size Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increase CA cert size to 2048 bits Increase CA cert size to 2048 bits Disables basic TLS tests Re-enables but disables Ensures that vtgateclienttest mocks terminate after each test suite Adds delay in unit tests to make sure VTGate has time to start and stop Restores as a subclass of bugfix Reverts temporary changes Cleanup after git squash Experimenting with removing sleeps from Experimenting with removing sleeps from and
2017-02-03 02:40:27 +03:00
# When this script is run with the argument "--enable-tls", then it will connect to VTGate using TLS with
# client authentication. This option depends upon the "vtgate-up.sh" script having also been run with
# a corresponding "--enable-tls" argument.
optional_tls_args=''
if [ "$1" = "--enable-tls" ];
then
echo "Enabling TLS with client authentication"
cert_dir=$VTDATAROOT/tls
rm -f $cert_dir/ca-trustStore.jks
rm -f $cert_dir/client-keyStore.jks
# Create CA trustStore
openssl x509 -outform der -in $cert_dir/ca-cert.pem -out $cert_dir/ca-cert.der
keytool -import -alias cacert -keystore $cert_dir/ca-trustStore.jks -file $cert_dir/ca-cert.der -storepass passwd -trustcacerts -noprompt
# Create client-side signed cert keyStore
openssl pkcs12 -export -in $cert_dir/client-cert.pem -inkey $cert_dir/client-key.pem -out $cert_dir/client-key.p12 -name cert -CAfile $cert_dir/ca-cert.pem -caname root -passout pass:passwd
keytool -importkeystore -deststorepass passwd -destkeystore $cert_dir/client-keyStore.jks -srckeystore $cert_dir/client-key.p12 -srcstoretype PKCS12 -alias cert -srcstorepass passwd
optional_tls_args="?useSSL=true&keyStore=$cert_dir/client-keyStore.jks&keyStorePassword=passwd&keyAlias=cert&trustStore=$cert_dir/ca-trustStore.jks&trustStorePassword=passwd&trustAlias=cacert"
echo $optional_tls_args
fi
# We have to install the "example" module first because Maven cannot resolve
# them when we run "exec:java". See also: http://stackoverflow.com/questions/11091311/maven-execjava-goal-on-a-multi-module-project
# Install only "example". See also: http://stackoverflow.com/questions/1114026/maven-modules-building-a-single-specific-module
mvn -f $VTROOT/java/pom.xml -pl example -am install -DskipTests
mvn -f $VTROOT/java/example/pom.xml exec:java \
Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL (#2349) Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Trying unit tests with larger SSL key size Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increase CA cert size to 2048 bits Increase CA cert size to 2048 bits Disables basic TLS tests Re-enables but disables Somewhat decouples JDBC TLS unit tests Ensures that vtgateclienttest mocks terminate after each test suite Adds delay in unit tests to make sure VTGate has time to start and stop Adds logging of vtgateclienttest output Restores as a subclass of bugfix Reverts temporary changes Trying unit tests with larger SSL key size Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increase CA cert size to 2048 bits Increase CA cert size to 2048 bits Disables basic TLS tests Re-enables but disables Ensures that vtgateclienttest mocks terminate after each test suite Adds delay in unit tests to make sure VTGate has time to start and stop Restores as a subclass of bugfix Reverts temporary changes Cleanup after git squash Experimenting with removing sleeps from Experimenting with removing sleeps from and
2017-02-03 02:40:27 +03:00
-Dexec.cleanupDaemonThreads=false \
-Dexec.mainClass="io.vitess.example.VitessJDBCExample" \
Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL (#2349) Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Adds support to VitessJDBCUrl for parsing optional parameter to enable SSL Adds remaining SSL-related optional parameters to JDBC URL strings Moves JDBC driver layer closer to passing TLS credentials to the gRPC client layer Hands off TLS from the Java/JDBC layer to the gRPC client layer Code review updates First cut at unit testing of SSL connection from gRPC layer to VTGate Not setting keyManager on gRPC client when client authentication is unused Adds TLS to client side of Grpc unit test Adds netty-tcnative to gRPC client classpath, and couple of bugfixes Fixes bugs... first successful test of SSL connection from client to vtgateclienttest mock. Adds unit test coverage for SSL connection with client authentication enabled. Updates 'grpc-all' and 'netty-tcnative' dependencies to latest versions Improves null-check and handling Adds optional argument to 'examples/local' scripts, to allow end-to-end testing of TLS connection to VTGate Builds optional 'fat JAR' of JDBC driver, for use in standalone situation such as DBeaver, SQuirreL, etc. Adds JavaDocs, and misc cleanup Temporarily ignores TLS unit tests, to diagnose issue with Travis CI Redirects IO from external OpenSSL processes to Travis CI console log Improves logging Temporarily disables SSL in TLS unit test Temporarily disables SSL in TLS unit test Restores disabled unit tests Testing Travis CI issues Travis testing Adds explicit delays to test race condition theory Travis testing Testing Travis Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Adds more logging Restores state prior to Travis CI testing Trying unit tests with larger SSL key size Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increase CA cert size to 2048 bits Increase CA cert size to 2048 bits Disables basic TLS tests Re-enables but disables Somewhat decouples JDBC TLS unit tests Ensures that vtgateclienttest mocks terminate after each test suite Adds delay in unit tests to make sure VTGate has time to start and stop Adds logging of vtgateclienttest output Restores as a subclass of bugfix Reverts temporary changes Trying unit tests with larger SSL key size Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increased logging to identify java.security settings Increase CA cert size to 2048 bits Increase CA cert size to 2048 bits Disables basic TLS tests Re-enables but disables Ensures that vtgateclienttest mocks terminate after each test suite Adds delay in unit tests to make sure VTGate has time to start and stop Restores as a subclass of bugfix Reverts temporary changes Cleanup after git squash Experimenting with removing sleeps from Experimenting with removing sleeps from and
2017-02-03 02:40:27 +03:00
-Dexec.args="localhost:15991$optional_tls_args"