question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSL to MySQL from CLI: need to add extra arguments

See original GitHub issue
Which version and edition of Flyway are you using?

Flyway Community Edition 6.4.0 by Redgate

If this is not the latest version, can you reproduce the issue with the latest one as well?
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command-line.

Which database are you using (type & version)?

AWS RDS MySQL 5.7.22.

Which operating system are you using?
 $ cat /etc/os-release 
PRETTY_NAME="Devuan GNU/Linux 3 (beowulf)"
NAME="Devuan GNU/Linux"
VERSION_ID="3"
VERSION="3 (beowulf)"
VERSION_CODENAME=beowulf
ID=debian
ID_LIKE=debian
HOME_URL="https://www.devuan.org/"
SUPPORT_URL="https://devuan.org/os/community"
BUG_REPORT_URL="https://bugs.devuan.org/"
What did you do?
What did you expect to see?
What did you see instead?

I’ve successfully established SSL connection to AWS RDS with Flyway CLI, but I had to edit shell-script https://github.com/flyway/flyway/blob/master/flyway-commandline/src/main/assembly/flyway to add extra arguments:

EXTRA_ARGS=
if $linux; then
  EXTRA_ARGS=-Djava.security.egd=file:/dev/../dev/urandom
fi
EXTRA_ARGS="$EXTRA_ARGS -Djavax.net.ssl.trustStore=~/aws_rds_truststore.jks -Djavax.net.ssl.trustStorePassword=changeit"

if `command -v cygpath > /dev/null`; then CP=`cygpath -pw "$CP"`; fi
"$JAVA_CMD" $JAVA_ARGS $EXTRA_ARGS -cp "$CP" org.flywaydb.commandline.Main "$@"

Could you please add possibility to add arguments without patching your shell script?

For example, by FLYWAY_EXTRA_ARGS:

EXTRA_ARGS=${FLYWAY_EXTRA_ARGS:=}
if $linux; then
  EXTRA_ARGS="$EXTRA_ARGS -Djava.security.egd=file:/dev/../dev/urandom"
fi

Then I will create documentation how to connect Flyway to MySQL with SSL.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
vazhnovcommented, Apr 30, 2020
export JAVA_ARGS="-Djavax.net.ssl.trustStore=~/aws_rds_truststore.jks -Djavax.net.ssl.trustStorePassword=changeit"

works fine. Thank you very much!

0reactions
vazhnovcommented, Apr 30, 2020

@MikielAgutu , JAVA_ARGS looks good! Let me check…

Read more comments on GitHub >

github_iconTop Results From Across the Web

4.2.3 Command Options for Connecting to the Server
To specify additional parameters for encrypted connections, consider setting at least the ssl_cert and ssl_key system variables on the server side and the...
Read more >
MySQL Shell 8.0 :: 4.3.3 Using Encrypted Connections
Using encrypted connections is possible when connecting to a TLS (sometimes referred to as SSL) enabled MySQL server. Much of the configuration of...
Read more >
6.3.1 Configuring MySQL to Use Encrypted Connections
On the server side, the --ssl option specifies that the server permits but does not require encrypted connections. This option is enabled by...
Read more >
6.3.3.2 Creating SSL Certificates and Keys Using openssl
This section describes how to use the openssl command to set up SSL certificate and key files for use by MySQL servers and...
Read more >
6.9 Connecting Securely Using SSL - MySQL :: Developer Zone
You need the file names and the associated passwords to create an SSL connection. ... Supply the proper arguments for the command options....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found