Skip to content

Commit

Permalink
[misc] travis hostname change for hostname verification
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Jul 29, 2017
1 parent c6b1033 commit a3c6b44
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,10 @@
sudo: false
language: java
services: docker
addons:
hosts:
- mariadb.example.com

before_install:
- chmod +x .travis/script.sh
- echo "MAVEN_OPTS='-Xmx384m'" > ~/.mavenrc
Expand Down
22 changes: 11 additions & 11 deletions .travis/script.sh
Expand Up @@ -11,34 +11,34 @@ export COMPOSE_FILE=.travis/docker-compose.yml

case "$TYPE" in
"REWRITE" )
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&rewriteBatchedStatements=true&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&rewriteBatchedStatements=true&enablePacketDebug=true'
;;
"PREPARE" )
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&useServerPrepStmts=true&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&useServerPrepStmts=true&enablePacketDebug=true'
;;
"MULTI" )
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&allowMultiQueries=true&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&allowMultiQueries=true&enablePacketDebug=true'
;;
"BULK_SERVER" )
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&useBatchMultiSend=true&useServerPrepStmts=true&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&useBatchMultiSend=true&useServerPrepStmts=true&enablePacketDebug=true'
;;
"NO_BULK_CLIENT" )
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&useBatchMultiSend=false&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&useBatchMultiSend=false&enablePacketDebug=true'
;;
"NO_BULK_SERVER" )
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&useBatchMultiSend=false&useServerPrepStmts=true&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&useBatchMultiSend=false&useServerPrepStmts=true&enablePacketDebug=true'
;;
"COMPRESSION" )
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&useCompression=true&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&useCompression=true&enablePacketDebug=true'
;;
*)
if [ -n "$MAXSCALE_VERSION" ]
then
urlString='jdbc:mariadb://localhost:4007/testj?user=bob&killFetchStmtOnClose=false&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:4007/testj?user=bob&killFetchStmtOnClose=false&enablePacketDebug=true'
mysql=( mysql --protocol=tcp -ubob -h127.0.0.1 --port=4007 )
export COMPOSE_FILE=.travis/maxscale-compose.yml
else
urlString='jdbc:mariadb://localhost:3305/testj?user=bob&enablePacketDebug=true'
urlString='jdbc:mariadb://mariadb.example.com:3305/testj?user=bob&enablePacketDebug=true'
fi
;;
esac;
Expand Down Expand Up @@ -87,8 +87,8 @@ else
if [ -n "$GALERA" ]
then
docker-compose -f .travis/galera-compose.yml up -d
urlString='jdbc:mariadb://localhost:3106/testj?user=bob&enablePacketDebug=true'
cmd+=( -DdefaultGaleraUrl="jdbc:mariadb:failover://localhost:3106,localhost:3107,localhost:3108/testj?user=bob&enablePacketDebug=true" )
urlString='jdbc:mariadb://mariadb.example.com:3106/testj?user=bob&enablePacketDebug=true'
cmd+=( -DdefaultGaleraUrl="jdbc:mariadb:failover://mariadb.example.com:3106,mariadb.example.com:3107,mariadb.example.com:3108/testj?user=bob&enablePacketDebug=true" )

fi

Expand Down
Expand Up @@ -694,7 +694,7 @@ private void handleConnectionPhases(String host) throws SQLException {
// perform hostname verification
// (rfc2818 indicate that if "client has external information as to the expected identity of the server,
// the hostname check MAY be omitted")
if (!options.disableSslHostnameVerification) {
if (!options.disableSslHostnameVerification && !options.trustServerCertificate) {
HostnameVerifierImpl hostnameVerifier = new HostnameVerifierImpl();
SSLSession session = sslSocket.getSession();
if (!hostnameVerifier.verify(host, session)) {
Expand Down

0 comments on commit a3c6b44

Please sign in to comment.